Fullscreen display colors and blends incorrectly

Started by
1 comment, last by kordova 17 years, 9 months ago
This could possibly be an SDL issue, as I am using SDL to set up an OpenGL rendering context. Anyway, I have been testing an application in windowed mode until today. Unfortunately, when I entered fullscreen mode the colorating and blending seem to be functioning incorrectly. Windowed example: Fullscreen example: I thought that it might be texture related, but rendering a three colored triangle displays the same poor effects. My SDL initialization code is:

  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_BUFFER_SIZE, 32 );
  SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 16 );
  SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );                                               
  
  // SDL_OPENGLBLIT allows SDL to draw alongside OpenGL
  // Use SDL_OPENGL if OpenGL exclusive application
  Uint32 flags = SDL_OPENGL | SDL_HWSURFACE;
  if ( _fullscreen ) {
    flags |= SDL_FULLSCREEN;
  }

  _screen = SDL_SetVideoMode( _windowWidth, _windowHeight, 16,                  flags );

  if ( !_screen ) {
    printf( "ERROR: Unable to initialize SDL screen: %s", SDL_GetError( )); 
    return false;
  }
  
  if ( !( _screen->flags & SDL_HWSURFACE )) {
    printf( "WARNING: Can't get hardware surface\n" );
  }

I get the warning when in windowed mode so I believe that to be the source of the issue. Thanks in advance.
Advertisement
Are you setting the full-screen color depth to 24/32 bit?
---------------------------------Upon thine ass shall I bust but a single cap.
That param to SDL_SetVideoMode should be 32, not 16. I was too focused on the set attribute functions. Thanks.

This topic is closed to new replies.

Advertisement