Hi, I’m experiencing a crash on MacOS X when setting up an SDL OpenGL window.
I’m using MacOS Leopard 10.5.2, and SDL 1.2.13 on a new MacBook Pro.
This code worked flawlessly in Ubuntu Feisty Fawn, btw.
The line that makes it crash is this one:
surface = SDL_SetVideoMode (windowWidth, windowHeight, windowDepth, videoFlags);
Variables status:
- windowWidth : 800
- windowHeight: 600
- windowDepth: 24
- videoFlags : 0x20000017
I’m taking the videoFlags based on SDL_GetVideoInfo, which returns a
struct with all fields set to 0 except for these ones:
- vfmt: 0x120910
- wm_available: 1
- current_h: 900
- current_w: 1440
Unfortunately, I couldn’t get much more of a backtrace than this from XCode:
#4 0x000b2d8f in SDL_SoftStretch ()
No symbol table info available.
#5 0x000b1a5c in SDL_SoftStretch ()
No symbol table info available.
#6 0x000a53e7 in SDL_SetVideoMode ()
No symbol table info available.
Looking at SDL 1.2.13 changelog, I’ve seen that a crash related to
SDL_SoftStretch has been fixed in this SDL version. Maybe this is
somehow related to that?
Thanks in advance for any help or hints.
BTW, the code that makes it crash is this classical initialization stuff:
------------------------------------------------------8<------------------------------------------------------
int videoFlags;
const SDL_VideoInfo *videoInfo;
if (SDL_Init (SDL_INIT_VIDEO) < 0)
{
fprintf (stderr, "Video initialization failed: %s\n",SDL_GetError ());
exit(-1);
}
atexit (SDL_Quit);
videoInfo = SDL_GetVideoInfo ();
if (!videoInfo)
{
fprintf (stderr, "Video query failed: %s\n", SDL_GetError ());
exit(-1);
}
videoFlags = SDL_OPENGL |SDL_GL_DOUBLEBUFFER |SDL_HWPALETTE | SDL_RESIZABLE;
if (videoInfo->hw_available)
videoFlags |= SDL_HWSURFACE;
else
videoFlags |= SDL_SWSURFACE;
if (videoInfo->blit_hw)
videoFlags |= SDL_HWACCEL;
SDL_EnableKeyRepeat (30, SDL_DEFAULT_REPEAT_INTERVAL);
SDL_GL_SetAttribute (SDL_GL_DOUBLEBUFFER, 1);
surface = SDL_SetVideoMode (windowWidth, windowHeight, windowDepth,
videoFlags);
------------------------------------------------------>8------------------------------------------------------