SDL 1.2.12 MinGW crashes due to GDI autoselction

Hi,

Updating SDL from 1.2.11 to 1.2.12 for the MinGW compilation of Enigma
(http://www.nongnu.org/enigma) resulted in app crashes. On debugging I
noticed that SDL 1.2.12 does obviously not select the DirectX but the
GDI driver.

The crashes occur on the first call of SDL_SetGamma() which might not be
supported for GDI but should nevertheless not crash.

I tested with
http://www.libsdl.org/release/SDL-devel-1.2.12-mingw32.tar.gz and own
compilations of the SDL source packages.

Forcing SDL to select the DirectX driver within our app via:

#ifdef WIN32
SDL_putenv(“SDL_VIDEODRIVER=directx”);
#endif

is a workaround. But are there any reasons for the diver selection change?

Greets,

Ronald

Tux Paint had numerous issues running fullscreen on various Windows
systems when Direct X was used. [1] For previous releases, we suggested people
change their Windows env. variable to use WinDib instead of Direct X for SDL.

I guess people here decided the issue was ‘big enough’ that SDL, by default,
should use GDI, to avoid these issues.

(For some reason, the name “Dell” comes to mind ;^) )

[1] http://www.tuxpaint.org/docs/known_issues/0.9.15/
"Tux Paint reboots my system;
Fullscreen mode causes monitor synchronization problems;
Mouse or stylus does not work properly in fullscreen"On Tue, Aug 07, 2007 at 10:35:04PM +0200, Ronald Lamprecht wrote:

Forcing SDL to select the DirectX driver within our app via:

#ifdef WIN32
SDL_putenv(“SDL_VIDEODRIVER=directx”);
#endif

is a workaround. But are there any reasons for the diver selection change?


-bill!
bill at newbreedsoftware.com
http://www.newbreedsoftware.com/

Hello !

I guess people here decided the issue was ‘big enough’ that SDL, by
default,
should use GDI, to avoid these issues.

(For some reason, the name “Dell” comes to mind ;^) )

We should add a section to SDL, what has changed because
of TuxPaint, no just joking :slight_smile:

SDL 1.2 uses DirectX 5, a really old version of DirectX now.
Microsoft will not take much care and effort
into doing the emulation layer for DX5. So in the future
there will be more problems with it, then less.

GDI was used by normal Windows apps and so MS
needs to be carefull, as it should be still possible
to run old apps, what they definitely want.

CU

Hi,

Bill Kendrick wrote:

Forcing SDL to select the DirectX driver within our app via:

#ifdef WIN32
SDL_putenv(“SDL_VIDEODRIVER=directx”);
#endif

is a workaround. But are there any reasons for the diver selection change?

Tux Paint had numerous issues running fullscreen on various Windows
systems when Direct X was used. [1] For previous releases, we suggested people
change their Windows env. variable to use WinDib instead of Direct X for SDL.

I guess people here decided the issue was ‘big enough’ that SDL, by default,
should use GDI, to avoid these issues.

Looking at src/video/video.c for SDL 1.2.12 as well as 1.2.11 we have:

static VideoBootStrap *bootstrap[] = {
[…]
#if SDL_VIDEO_DRIVER_WINDIB
&WINDIB_bootstrap,
#endif
#if SDL_VIDEO_DRIVER_DDRAW
&DIRECTX_bootstrap,
#endif

If this defines the auto selection priorities then nothing has changed.

BTW how is it possible to determine the driver selected by SDL?

If both SDL versions do prefer the GDI then Enigma did run with GDI
perfectly in 1.2.11 but crashes within SDL_SetGamma() in 1.2.12 !

You can download Enigma 1.01, exchange the SDL.dll and test and debug
the modified GDI driver. I did test and check on XP and Vista.

Greets,

Ronald> On Tue, Aug 07, 2007 at 10:35:04PM +0200, Ronald Lamprecht wrote: