Screenshot problems

Hi

Im having problems accessing the current visible surface.
I use SDL_SaveBMP( SDL_GetVideoSurface(), file ); to take a screenshot
(Im not using OGL) but this image is black.
I think i know why its black, I flip and clear the surface I use for draving
like this:
SDL_Flip(sdlSurf);
SDL_FillRect(sdlSurf, NULL, 0x000000);

where sdlSurf = SDL_SetVideoMode(width, height, depth, VideoFlags);

Apperently SDL_GetVideoSurface() doesn’t return the surface that are displayd at
the moment, I read this post http://thread.gmane.org/gmane.comp.lib.sdl/4791
that’s almost the same problem I have, has this been solved ?

I could just take a screenshot before i call Flip but will interrupt the flow of
my program and look very ugly.

Henrik,
why not just blank your screen(FillRect) BEFORE doing all of the drawing &
screen flip? That way, you don’t need to move your screenshot function, and
it doesn’t interrupt the “flow” of your program design. Just my 2 cents…
-Dave> ----- Original Message -----

From: drx@drx.dk (Henrik)
To:
Sent: Saturday, January 29, 2005 8:54 AM
Subject: [SDL] Screenshot problems

Hi

Im having problems accessing the current visible surface.
I use SDL_SaveBMP( SDL_GetVideoSurface(), file ); to take a screenshot
(Im not using OGL) but this image is black.
I think i know why its black, I flip and clear the surface I use for
draving
like this:
SDL_Flip(sdlSurf);
SDL_FillRect(sdlSurf, NULL, 0x000000);

where sdlSurf = SDL_SetVideoMode(width, height, depth, VideoFlags);

Apperently SDL_GetVideoSurface() doesn’t return the surface that are
displayd at
the moment, I read this post
http://thread.gmane.org/gmane.comp.lib.sdl/4791
that’s almost the same problem I have, has this been solved ?

I could just take a screenshot before i call Flip but will interrupt the
flow of
my program and look very ugly.


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl