SDL_CreateWindow failing in WinXP VM

SDL_GetError returns the following cryptic message: (note this XP installation is in french)

‘LoadLibrary(“OPENGL32.DLL”): ???

my top priority is to seamlessly support as many devices as possible. i don’t really care if this app works in a VM, but i need to be sure the error messages make sense and help me quickly send patches out to eventual customers. i haven’t dug into the source of SDL_GetError() since i’d rather get back to work on my app =) but i’m willing to do more tests if the following info isn’t specific enough.

thanks anyone for your help.

the call to CreateWindow is as follows:
SDL_CreateWindow(“View0”, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 500, 500, SDL_WINDOW_OPENGL)

i don’t think it’s a noob error (for once hehe) because:
-the OpenGL Benchmark tool functions properly in the VM. [http://www.majorgeeks.com/files/details/opengl_geometry_benchmark.html].
-the same code functions on Linux and MacOSX so far.
-an earlier version worked in the VM when not specifying OpenGL as the renderer.

SDL detects the following:

Code:
SDL_GetNumVideoDrivers gave 2
SDL_GetVideoDriver(0) returned "windows"
SDL_GetVideoDriver(1) returned "dummy"
SDL_VideoInit(windows)…
SDL_VideoInit(windows) succeeded
detected display count: 1
display 0 extents: 0, 0 to 800, 600
mode 0: 24 bit 800x600 60Hz

Code:------------------------------------
SDL_GetRenderDriverInfo(1) opengl:
flags:
SDL_RENDERER_ACCELERATED: the renderer uses hardware acceleration
SDL_RENDERER_PRESENTVSYNC: present is synchronized with the refresh rate. (present meaning to present the pixels to the screen)
SDL_RENDERER_TARGETTEXTURE: the renderer supports rendering to texture
max texture width: 0
max texture height: 0

texture formats: 1

compiler: mingw32
os: windows XP pro SP2 french
libs: -lmingw32 -lSDL2main -lSDL2 -mwindows -lm -luser32 -lgdi32
-lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lversion
-luuid -static-libgcc -lopengl32 -static-libstdc++

Can you specify what VM engine you were using to run the test? Quite a lot
of them don’t offer accelerated graphics support, and SDL requires GL 2.1
for accelerated renderer support on the desktop. Windows itself bundles in
software rendering support for up to GL 1.1, which would plausibly fool
that ancient benchmark tool you tried.

You can check the OpenGL specs of your Windows VM with this tool -
http://www.realtech-vr.com/glview . If they’re not up to scratch, consider
using a VM which supports acceleration via guest drivers, such as VMware
Fusion or VirtualBox.On 22 September 2013 02:36, carl <carl.lefrancois at gmail.com> wrote:

**
SDL_GetError returns the following cryptic message: (note this XP
installation is in french)

‘LoadLibrary(“OPENGL32.DLL”): ??? ??? ?? ??
??? ??? ???

my top priority is to seamlessly support as many devices as possible. i
don’t really care if this app works in a VM, but i need to be sure the
error messages make sense and help me quickly send patches out to eventual
customers. i haven’t dug into the source of SDL_GetError() since i’d rather
get back to work on my app =) but i’m willing to do more tests if the
following info isn’t specific enough.

thanks anyone for your help.

the call to CreateWindow is as follows:
SDL_CreateWindow(“View0”, SDL_WINDOWPOS_UNDEFINED,
SDL_WINDOWPOS_UNDEFINED, 500, 500, SDL_WINDOW_OPENGL)

i don’t think it’s a noob error (for once hehe) because:
-the OpenGL Benchmark tool functions properly in the VM. [
http://www.majorgeeks.com/files/details/opengl_geometry_benchmark.html].
-the same code functions on Linux and MacOSX so far.
-an earlier version worked in the VM when not specifying OpenGL as the
renderer.

SDL detects the following:

Code:

SDL_GetNumVideoDrivers gave 2
SDL_GetVideoDriver(0) returned "windows"
SDL_GetVideoDriver(1) returned "dummy"
SDL_VideoInit(windows)…
SDL_VideoInit(windows) succeeded
detected display count: 1
display 0 extents: 0, 0 to 800, 600
mode 0: 24 bit 800x600 60Hz

Code:


SDL_GetRenderDriverInfo(1) opengl:
flags:
SDL_RENDERER_ACCELERATED: the renderer uses hardware acceleration
SDL_RENDERER_PRESENTVSYNC: present is synchronized with the refresh
rate. (present meaning to present the pixels to the screen)
SDL_RENDERER_TARGETTEXTURE: the renderer supports rendering to texture
max texture width: 0
max texture height: 0

texture formats: 1

compiler: mingw32
os: windows XP pro SP2 french
libs: -lmingw32 -lSDL2main -lSDL2 -mwindows -lm -luser32 -lgdi32
-lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lversion
-luuid -static-libgcc -lopengl32 -static-libstdc++


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Also, you might to do a full debug build of SDL2, start your application in
gdb, put a breakpoint in WIN_SetError in src/core/windows/SDL_windows.c
(about line 40), and post a binary/hex copy of the data in ‘buffer’ and
’message’.

The garbled stuff in the error message after “LoadLibrary(“OPENGL32.DLL”):
” is the text output Windows provided for the error, which SDL has (tried
to?) convert to UTF-8. WIN_StringToUTF8 looks pretty simplistic (it either
expects Unicode or ASCII), so it has probably fallen over on whichever
obscure codepage the French VM uses.On 22 September 2013 08:02, Scott Percival <@Scott_Percival>wrote:

Can you specify what VM engine you were using to run the test? Quite a lot
of them don’t offer accelerated graphics support, and SDL requires GL 2.1
for accelerated renderer support on the desktop. Windows itself bundles in
software rendering support for up to GL 1.1, which would plausibly fool
that ancient benchmark tool you tried.

You can check the OpenGL specs of your Windows VM with this tool -
http://www.realtech-vr.com/glview . If they’re not up to scratch,
consider using a VM which supports acceleration via guest drivers, such as
VMware Fusion or VirtualBox.

On 22 September 2013 02:36, carl <carl.lefrancois at gmail.com> wrote:

**
SDL_GetError returns the following cryptic message: (note this XP
installation is in french)

‘LoadLibrary(“OPENGL32.DLL”): ??? ??? ?? ??
??? ??? ???

my top priority is to seamlessly support as many devices as possible. i
don’t really care if this app works in a VM, but i need to be sure the
error messages make sense and help me quickly send patches out to eventual
customers. i haven’t dug into the source of SDL_GetError() since i’d rather
get back to work on my app =) but i’m willing to do more tests if the
following info isn’t specific enough.

thanks anyone for your help.

the call to CreateWindow is as follows:
SDL_CreateWindow(“View0”, SDL_WINDOWPOS_UNDEFINED,
SDL_WINDOWPOS_UNDEFINED, 500, 500, SDL_WINDOW_OPENGL)

i don’t think it’s a noob error (for once hehe) because:
-the OpenGL Benchmark tool functions properly in the VM. [
http://www.majorgeeks.com/files/details/opengl_geometry_benchmark.html].
-the same code functions on Linux and MacOSX so far.
-an earlier version worked in the VM when not specifying OpenGL as the
renderer.

SDL detects the following:

Code:

SDL_GetNumVideoDrivers gave 2
SDL_GetVideoDriver(0) returned "windows"
SDL_GetVideoDriver(1) returned "dummy"
SDL_VideoInit(windows)…
SDL_VideoInit(windows) succeeded
detected display count: 1
display 0 extents: 0, 0 to 800, 600
mode 0: 24 bit 800x600 60Hz

Code:


SDL_GetRenderDriverInfo(1) opengl:
flags:
SDL_RENDERER_ACCELERATED: the renderer uses hardware acceleration
SDL_RENDERER_PRESENTVSYNC: present is synchronized with the refresh
rate. (present meaning to present the pixels to the screen)
SDL_RENDERER_TARGETTEXTURE: the renderer supports rendering to texture
max texture width: 0
max texture height: 0

texture formats: 1

compiler: mingw32
os: windows XP pro SP2 french
libs: -lmingw32 -lSDL2main -lSDL2 -mwindows -lm -luser32 -lgdi32
-lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lversion
-luuid -static-libgcc -lopengl32 -static-libstdc++


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

thanks for you insight regarding the error message. that’s what really matters! regardless what funky language my eventual customer uses, i want the error message he sends me to be legible.

i suppose my best bet is to recompile SDL to avoid doing this conversion or spit out the raw AND converted text. :confused:

btw it was easy to fool me :slight_smile: i was sure the fact any opengl program worked meant SDL opengl should as well!

thanks for the info that SDL requires GL 2.1. after some research i had settled on minimum opengl1.1 since cross-platform compatibility is way ahead of performance in my priority list.

i’m not interested in debugging or using breakpoints, sorry. i used to code that way but prefer log messages since i switched to multithreading.

interestingly, when i ran the same .exe on my windows 7 64bit machine (not vm) the output was the same. this seems to point to a mingw32-induced problem with converting the raw windows error text…

almost forgot. the vm software is virtualbox running under ubuntu 12.04. 3d acceleration is off since turning it on prevents the opengl benchmark from running o_O. i had tried turning it on and the result was the same. will post back with more info using the tool you suggested.

SDL forum rules =)

sure enough, your new-wave suggestion confirmed (after requiring installation of 30 Mb of microsoft cruft) that the opengl version is 1.1. interestingly, the tool detects 1.1 (presumably via software emulation) when 3D acceleration is turned off in the vm config and crashes the vm when 3d acceleration is turned on.