Jump to content
  • Advertisement
Sign in to follow this  
v_janssens

Save SDL Window

This topic is 3269 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

Hi, I am using SDL and a program I have written myself in C++ to solve an structural engineering problem that I am researching. My main expertise is in structural engineering and my programming skills are very limited so please excuse any obvious questions. I am currently using SDL to output the response of various buildings to different loads graphically (this may not be the best approach but I had used SDL as part of my undergrad so had the basics build upon). Currently these images are just popping up as windows which I had been taking screenshots of to save.... not the most efficient approach!! I am wondering if there is a way to save the images I'm creating without going through this? I done quite a bit of research on this but can't find much information. I am aware of the existance of a SDL_Image library but this appears to aimed at loading images. Any advice you can offer would be really appreciated.

Share this post


Link to post
Share on other sites
Advertisement
int SDL_SaveBMP(SDL_Surface *surface, const char *file);
Saves just pass your screen pointer as the surface and the name of the file you want to save as
eg:

SDL_SaveBMP(screen,"SDL_cap.bmp");
Note: it doesn't check if the file exist, if you want for file existence you'd have to do it otherwise

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!