SDL2 + X11 + OS X - is it broken?

Hi all,
as usual, I’m having problems with Exult (http://exult.sf.net).

The usual way to run Exult is that it uses a surface on the native video driver.

We have however a map building Gtk app (Exult Studio) that needs X11 to communicate with Exult (mostly for drag’n’ drop - no one has ported SDL2 d’n’d yet). When we build Exult with Exult Studio support it means that Exult will run in X11 on OS X. This worked and still works with SDL 1.2x but is broken with SDL2. On OS X only, it works just fine on Linux.

On OS X it displays a “Couldn’t create window: No OpenGL support in video driver”.
I’ve tinkered with everything that I could think of, instead of pointing at the pre-built Xquartz, I’ve built it in MacPorts and pointed at that. Tried different SDL2 built options (SDL2 configure usually displays
Video drivers : dummy cocoa x11(dynamic) opengl opengl).

It seems to me as if there is something broken with SDL2 + X11 + OS X, possibly a requirement of SDL2 on OS X that the Xquartz pre-built or MacPorts don’t provide.

Does anyone have a simple testcase for X11 that I can use? Exult is a bit much to use as a testcase and too many factors that could be a problem.

On OS X it displays a “Couldn’t create window: No OpenGL support in
video driver”.

This is definitely working for me with Xquartz (but fails to create a
GLX window on Xquartz, which is a regression since SDL 1.2). Can you
send me the full config.log where it should be working? That error
means SDL didn’t build with GLX support at all.

–ryan.

I’ll be able to do that next week. But I wonder whether there is a simple x11 testcase to test SDL2 + x11 on OS X.
SDL’s videotest is defaulting to cocoa ;(

SDL_VIDEODRIVER=x11 ./testsprite2

(this fails to find a GLX visual at the moment on Xquartz. The
equivalent in SDL 1.2 still works with Xquartz on macOS 10.12.2, though,
and I haven’t researched further than that yet. Presumably this is
fixable, though.)

–ryan.On 1/6/17 5:34 AM, Dominus wrote:

I’ll be able to do that next week. But I wonder whether there is a
simple x11 testcase to test SDL2 + x11 on OS X.
SDL’s videotest is defaulting to cocoa ;(

(this fails to find a GLX visual at the moment on Xquartz. The
equivalent in SDL 1.2 still works with Xquartz on macOS 10.12.2, though,
and I haven’t researched further than that yet. Presumably this is
fixable, though.)

This is fixed as of https://hg.libsdl.org/SDL/rev/7c19d6525105

–ryan.

This seems to have fixed my problem with X11.

Tested with building against macports x11 stuff.

Build SDL2 with those commands

Code:
SDK=’ -I/usr/X11R6/include/‘
export MACOSX_DEPLOYMENT_TARGET=10.12
export PATH=/opt/local/bin/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11R6/bin
export CC="/usr/bin/clang"
export CXX="/usr/bin/clang++"
export CPPFLAGS=’-I/opt/local/include ‘$SDK
export CFLAGS=’-I/opt/local/include ‘$SDK
export CXXFLAGS=’-I/opt/local/include ‘$SDK
export LDFLAGS=’-L/opt/local/lib '$SDK
export PKG_CONFIG_PATH="/opt/local/lib/pkgconfig"
export PKG_CONFIG=/opt/local/bin/pkg-config
./autogen.sh
./configure --prefix=/users/testuser/code/test/sdl2
make clean
make install
cd test
/.autogen.sh
./configure --with-sdl-prefix=/users/testuser/code/test/sdl2
make clean
make testsprite
export SDL_VIDEODRIVER=x11
./testsprite

With rev 10780 "Couldn’t create window: No OpenGL support in video driver"
With rev 10781 it succeeded and I got to see the dancing smilies!

So bug resolved! many thanks Ryan for yet another quick save! :slight_smile: