[SDL] Bug in SDL_GetVideInfo() ?

Bill Kendrick nbs at sonic.net
Tue Aug 9 10:52:52 PDT 2005


On Tue, Aug 09, 2005 at 12:36:42PM +0200, Koshmaar wrote:
> SDL_Surface * screen = SDL_SetVideoMode (640, 480, 16, SDL_HWSURFACE | SDL_FULLSCREEN  );
>   
>   if (screen == 0)
>    return 1;
>    
>   if (screen->flags & SDL_HWSURFACE  == 0)
>    fprintf(stderr, "Can't get hardware surface\n");
>    
>   DumpVideoInfo();
> 
> ...
> 
> If there's no SDL_FULLSCREEN, there's "Can't get hardware surface" in stderr. However, when there are both SDL_HWSURFACE | SDL_FULLSCREEN, there's no "Can't get hardware surface", what means - video surface is in hardware. And even then, it still returns 0.

Doesn't that just mean SDL_SetVideoMode failed?  Have you checked
SDL_GetError() in that case?  e.g.:

  if (screen == NULL)
  {
    fprintf(stderr, "Can't open video: %s\n", SDL_GetError());
    return(1);
  }

???

-bill!




More information about the SDL mailing list