Hi all,
I was playing a little bit with the SDL2 library last night, and I hit a
problem that looks like a nasty SDL bug…
I am primarily developing on Linux, and there my code works fine, but
then I tried to port my app to Windows, using a Windows XP system
running on a VirtualBox. The code compiles fine, but whenever it tries
to call SDL_CreateRenderer, the application crashes.
I don’t post my code, because I think it is irrelevant - to be sure, I
also tested with the official code example from there:
https://wiki.libsdl.org/SDL_CreateRenderer
…and it also crashes, at the same moment (calling SDL_CreateRenderer).
This is how I compile the application (I copied the list of parameters
from the sdl-config file shipped with the library):
C:>gcc -O3 -Wall -std=gnu89 test.c -o test.exe -lmingw32
-Dmain=SDL_main -lSDL2main -lSDL2 -mwindows -Wl,–no-undefined -lm
-ldinput8 -ldxguid -ldxerr8 -luser32 -lgdi32 -lwinmm -limm32 -lole32
-loleaut32 -lshell32 -lversion -luuid -static-libgcc
The SDL lib I test with is the v2.0.3. I also tested on v2.0.2 - same
result.
The Windows XP virtual machine I am testing this on is a bare, freshly
installed Windows XP service pack 3, without any add-ons.
To avoid crashing, I pass the parameter “SDL_RENDERER_SOFTWARE”. When
using no flags, or the “SDL_RENDERER_ACCELERATED” flag, it crashes.
I presume that the crash is somehow related to the fact that SDL tries
to probe for some acceleration magic, and hangs on it… Now, how should
I proceed to be able to use accelerating on systems that have such
capabilities, and avoid crashing on systems without any powerful GPU
(basic GDI) ?
best regards,
Mateusz