SFML playground
Go to file
Sven Hesse de0ba77d3b Unix: Filter X visual by X screen
On an X set-up with multiple monitors running separate X screens (as
opposed to merging them into one large X screen using Xinerama), the
selected X visual needs to be one for the screen where the colormap,
window, and other X resources are created. In fact, all these need to
match, and the GL context as well.

Most of the SFML windowing and graphics code uses (X)DefaultScreen()
for that, which is fine. Combined with XOpenDisplay(NULL), this will
create the window on the screen (and monitor) selected by the DISPLAY
enviroment variable. :0.0 will be the first monitor, :0.1 the second,
etc.

However, XGetVisualInfo() will return visuals for *all* screens, not
just the default one. They seem to be ordered by screen number, but I
don't think the standard makes any guarantees there.

If the visual doesn't match up with the screen, this will abort with
an X error. BadMatch, in many cases.

This means that in addition to other filtering,
GlxContext::selectBestVisual() needs to filter the visuals by screen
number, otherwise SFML won't work at all on any screens but the first.

This fixes issue #724.
2018-10-26 21:15:25 +02:00
.github Added GitHub issue and PR templates 2018-04-28 15:38:22 +02:00
cmake Fix audio components linking order 2018-08-14 14:59:57 +02:00
doc Only use 3 columns in the index 2018-05-06 08:42:42 +02:00
examples Disabled the JNI part due to compatibility issues 2018-10-11 21:57:12 +02:00
extlibs Added support for interfacing with joysticks via DirectInput when it is available. 2018-02-10 14:47:37 +01:00
include/SFML Updated the changelog and version number for 2.5.1 2018-10-15 21:52:40 +02:00
src/SFML Unix: Filter X visual by X screen 2018-10-26 21:15:25 +02:00
tools Android: Removed libsndfile from extlib build scripts 2018-04-28 13:12:20 +02:00
.editorconfig Added an .editorconfig file 2015-02-06 11:07:39 +01:00
.gitattributes Added a FLAC file to the Sound example to cover all three supported formats. 2015-03-28 22:49:46 +01:00
changelog.md Updated the changelog and version number for 2.5.1 2018-10-15 21:52:40 +02:00
CMakeLists.txt Updated the changelog and version number for 2.5.1 2018-10-15 21:52:40 +02:00
CONTRIBUTING.md Turned the header image in readme.md into a link. 2018-02-10 17:12:54 +01:00
license.md Updated the copyright year to 2018. 2018-02-10 14:51:46 +01:00
readme.md Turned the header image in readme.md into a link. 2018-02-10 17:12:54 +01:00

SFML logo

SFML — Simple and Fast Multimedia Library

SFML is a simple, fast, cross-platform and object-oriented multimedia API. It provides access to windowing, graphics, audio and network. It is written in C++, and has bindings for various languages such as C, .Net, Ruby, Python.

Authors

Download

You can get the latest official release on SFML's website. You can also get the current development version from the Git repository.

Install

Follow the instructions of the tutorials, there is one for each platform/compiler that SFML supports.

Learn

There are several places to learn SFML:

Contribute

SFML is an open-source project, and it needs your help to go on growing and improving. If you want to get involved and suggest some additional features, file a bug report or submit a patch, please have a look at the contribution guidelines.