tags 501116 pending
thanks

I can reproduce this on my Eee 901 (Intel GMA 950 graphics). The
ssgInit failure is a red herring, the real problem is that
SDL_SetVideoMode fails. SuperTuxKart requests a 24-bit OpenGL context,
which doesn't work when running X in 16-bit. It also requests a 24-bit
depth buffer which is apparently not supported by the GMA 950 hardware.

I've commited the attached patch to svn.

-- 
Peter De Wachter
--- a/src/sdldrv.cpp
+++ b/src/sdldrv.cpp
@@ -58,14 +58,13 @@
 	: sensedInput(0), actionMap(0), mainSurface(0), flags(0), stickInfos(0),
 	mode(BOOTSTRAP), mouseValX(0), mouseValY(0)
 {
-    SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK | SDL_INIT_TIMER);
+    if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK | SDL_INIT_TIMER) < 0)
+    {
+        fprintf(stderr, "SDL_Init failed: %s\n", SDL_GetError());
+        exit(1);
+    }
 
-    SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8);
-    SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8);
-    SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8);
-    SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 8);
     SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
-    SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24);
     SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 1);
 
     flags = SDL_OPENGL | SDL_HWSURFACE;
@@ -249,6 +248,13 @@
     SDL_FreeSurface(mainSurface);
     mainSurface = SDL_SetVideoMode(user_config->m_width, user_config->m_height, 0, flags);
 
+    if (!mainSurface)
+    {
+        fprintf(stderr, "SDL_SetVideoMode (%dx%d) failed: %s\n",
+                user_config->m_width, user_config->m_height, SDL_GetError());
+        exit(1);
+    }
+
 #if defined(WIN32) || defined(__APPLE__)
     if(resetTextures)
     {

Reply via email to