[SDL] how to know the surface is the screen or not?

Ryan C. Gordon icculus at icculus.org
Sun Jul 17 23:28:40 PDT 2011


>      if ( (dest_surface is screen)&&(screen is NOT doube buffered))

This is SDL 1.2, right?

If you're writing an SDL 1.2 driver:

  if ( (surface == SDL_VideoSurface) &&
       (surface->flags & SDL_DOUBLEBUF) == 0) )

SDL_VideoSurface (a macro) gets you the lowlevel SDL_Surface pointer 
that was provided by the driver during SDL_SetVideoMode().

(If this were an external app using SDL, you'd use SDL_GetVideoSurface() 
to get the Public surface, which is either what the driver provided in 
SDL_SetVideoMode(), or a shadow surface SDL is using to convert between 
the application and the driver's needs.)


In SDL 1.3, this works completely differently.

--ryan.




More information about the SDL mailing list