[SDL] Re: direct access to video memory

Alexander Chemeris alchemist at arctur.icb.psn.ru
Wed Jan 24 10:28:14 PST 2001


On Wed, Jan 24, 2001 at 06:30:10AM -0800, Randi J. Relander wrote:
> Alexander Chemeris wrote:
> > Gautier Portet wrote:
> > > if you call SDL_SetVideoMode with SDL_FULLSCREEN only
> > > (NOT SDL_DOUBLEBUF) you DO have direct video memory
> > > access (at least under win/dx)
> > This is extraction from my code:
> >
> > SDL_SetVideoMode(800,600,16,SDL_FULLSCREEN);
> > ...
> > SDL_Surface *video;
> > ...
> > video = SDL_GetVideoSurface();
> > ...
> > SDL_BlitSurface(Cursor[CurentCursor],NULL,video,vRect);
> >
> > So, cursor DIDN'T show on the screen.
> > But, after adding
> >
> > SDL_UpdateRects(video,2,tRect);
> >
> > it did.
> Shouldn't that be SDL_FULLSCREEN|SDL_HWSURFACE for direct access? Just using
> SDL_FULLSCREEN implies SDL_SWSURFACE and causes a shadow surface to be
> created. Blits go to the shadow and then update transfers shadow to screen.
> BTW, this is non-portable since direct access to the screen is not available
> on some (many?) platforms.
Hmm.. Thanx a lot for explanation.


Alexander Chemeris



More information about the SDL mailing list