Is there some GL function I need to call before setting up the screen again?
BTW here's my code:
Code: Select all
if( screen->flags & SDL_FULLSCREEN )
{
Setup( screen->w, screen->h, screen->format->BitsPerPixel, screen->flags ^ SDL_FULLSCREEN );
}
else
{
Setup( screen->w, screen->h, screen->format->BitsPerPixel, screen->flags | SDL_FULLSCREEN );
}
Code: Select all
if( ( screen = SDL_SetVideoMode( width, height, bpp, flags ) ) == NULL )
{
//Print Error
}
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_DEPTH_SIZE, 16 );
SDL_GL_SetAttribute( SDL_GL_BUFFER_SIZE, 32 );
SDL_GL_SetAttribute( SDL_GL_ACCUM_RED_SIZE, 8 );
SDL_GL_SetAttribute( SDL_GL_ACCUM_GREEN_SIZE, 8 );
SDL_GL_SetAttribute( SDL_GL_ACCUM_BLUE_SIZE, 8 );
SDL_GL_SetAttribute( SDL_GL_ACCUM_ALPHA_SIZE, 8 );
glClearColor( 0.75F, 0.75F, 1.0F, 0 );
glClearDepth( 1.0f );
glViewport( 0, 0, width, height );
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
glOrtho( 0, width, height, 0, 1, -1 );
glMatrixMode( GL_MODELVIEW );
glEnable( GL_TEXTURE_2D );
glLoadIdentity();
Any help is GREATLY appreciated.