This topic is now archived and is closed to further replies.

about screenshots

This topic is 5587 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

It don´t works for me. Screenshots made with SDL_SaveBMP(screen) always are black o white. Some idea ?

thx in advance

PD: sorry, my poor level of english limit my answers

[edited by - JAlonso on August 28, 2002 7:50:46 AM]

Share this post

Link to post
Share on other sites
Maybe you call SDL_SaveBMP(screen) after SDL_FillRect oder SDL_Flip?!

Try to call SDL_SaveBMP(screen) in different locations in your code.
The right one should be directly after the drawing code.


Share this post

Link to post
Share on other sites
it works now . I think the problem was that I put SDL_SaveBMP() after the first call to SDL_Flip() and because the hardware doublebuffer when returning from the call to SDL_Flip() the surface was in black.

If I put two calls to SDL_FLip() and then SDL_SaveBMP() it works too.

Thanks AfroFire and schiggl .

Share this post

Link to post
Share on other sites
you may also wanna implement some sort of save system that numbers the screenshots so that you can allow the user to take more than one:

void CVideo::CaptureImage()
// define the variables

char filename[16];

// create the filename


// save the screen

if (SDL_Failed(SDL_SaveBMP(psPrimary, filename)))
throw Error("could not capture screen", "CVideo.cpp", __LINE__);

// increment our counter in anticipation of another capture


capture_count starts at 0 and is incremented with each screen cap so you don''t keep overwriting the same file.


Drew Sikora
A.K.A. Gaiiden

ICQ #: 70449988
AOLIM: DarkPylat

Blade Edge Software
Staff Member, GDNet
Public Relations, Game Institute

3-time Contributing author, Game Design Methods , Charles River Media
Online column - Design Corner at Pixelate

Unnoficial IGDA chat! [ -> #igda]
NJ IGDA Chapter - NJ developers unite!! [Chapter Home | Chapter Forum]

"Real programmers don''t work from 9 to 5. If any real programmers are around at 9am it''s because they were up all night."

Share this post

Link to post
Share on other sites