[SDL] SDL OpenGL Hardware acceleration fail on MAC ?

Julien Meyer julien at jadeware.org
Tue Nov 11 13:36:03 PST 2003


Hello all !

I'm porting a SDL/OpenGL 3D game from Linux to Mac OS X and it seems 
that the game don't detect any opengl hardware acceleration, it's very 
slow.

Could Anyone help me ?

Best regards,
--Julien Meyer



My Apple computer graphic card hardware is:

GL_VENDOR: ATI Technologies Inc.
GL_RENDERER: ATI Radeon 7500 OpenGL Engine
GL_VERSION: 1.3 ATI-1.2.18


Here is the little piece of code I used to set up the OpenGL's 
videomode under Linux  and now Mac:


hBool sys_CreateGL(int width, int height, int bits)
{
    	if(SDL_Init( SDL_INIT_VIDEO ) < 0)
	{
	    fprintf(stderr, "Video initialization failed: %s\n", 
SDL_GetError());
	    return false;
	}

     	// Fetch the video info
     	videoInfo = SDL_GetVideoInfo();

     	if(!videoInfo)
	{
	    fprintf( stderr, "Video query failed: %s\n",
		     SDL_GetError( ) );
	    return false;
	}

     	// the flags to pass to SDL_SetVideoMode
     	videoFlags  = SDL_OPENGL;          /* Enable OpenGL in SDL */
     	videoFlags |= SDL_GL_DOUBLEBUFFER; /* Enable double buffering */
     	videoFlags |= SDL_HWPALETTE;       /* Store the palette in 
hardware */
     	videoFlags |= SDL_RESIZABLE;       /* Enable window resizing */
     	if(fullscreen.value)
     	{
     		videoFlags |= SDL_FULLSCREEN;       /* Enable window resizing */
	}

     /* This checks to see if surfaces can be stored in memory */
     if ( videoInfo->hw_available )
     {
	videoFlags |= SDL_HWSURFACE;
     }
     else
     {
	videoFlags |= SDL_SWSURFACE;
         fprintf( stderr, "No Hardware Accelerated Graphic mode found.. 
quiting\n");
         sys_end();
         return false;
     }

     /* This checks if hardware blits can be done */
     if ( videoInfo->blit_hw )
	videoFlags |= SDL_HWACCEL;

     /* Sets up OpenGL double buffering */
     SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );

     	// get a SDL surface
     	surface = SDL_SetVideoMode(	ScreenX[(int)videomode.value],
      				ScreenY[(int)videomode.value],
				(int)colordepth.value,
				videoFlags );

     	// Verify there is a surface
     	if ( !surface )
	{
	    fprintf( stderr, "Video mode set failed: %s\n", SDL_GetError( ) );
	    return false;
	}

	SDL_WM_SetCaption(NAME, NULL);

	return true;
}

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 3944 bytes
Desc: not available
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20031111/9785096b/attachment-0007.bin>


More information about the SDL mailing list