Direct access to video memory

Hi all!

How can I do subj?
Writing to the pointer returned by SDL_GetVideoSurface()
need SDL_UpdateRect() to be showed on the screen.
I used SDL 1.0.8 on Win98 with BCB4.0 (fuulscreen).
What is wrong?

Alexander Chemeris

Writing to the pointer returned by SDL_GetVideoSurface()
need SDL_UpdateRect() to be showed on the screen.
I used SDL 1.0.8 on Win98 with BCB4.0 (fuulscreen).
What is wrong?

if you call SDL_SetVideoMode with SDL_FULLSCREEN only (NOT SDL_DOUBLEBUF)
you DO have direct video memory access (at least under win/dx)

Gautier

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.

Alexander ChemerisOn Tue, Jan 23, 2001 at 10:02:38AM -0800, Gautier Portet wrote:

Writing to the pointer returned by SDL_GetVideoSurface()
need SDL_UpdateRect() to be showed on the screen.
I used SDL 1.0.8 on Win98 with BCB4.0 (fuulscreen).
What is wrong?
if you call SDL_SetVideoMode with SDL_FULLSCREEN only (NOT SDL_DOUBLEBUF)
you DO have direct video memory access (at least under win/dx)

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.

  • Randi

Regimental Command
Generic Armored Combat System
http://regcom.sourceforge.net

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.

That’s correct. If you specify SDL_FULLSCREEN and get SDL_HWSURFACE with
SDL 1.1.7, it’s a bug, so please let me know the details of the platform
and post sample code.

Thanks!
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

Hmm… Thanx a lot for explanation.

Alexander ChemerisOn 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.