Jump to content
  • Advertisement

Archived

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

DarkHamster

SDL Image Loading

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

I am trying to load images into SDL from files which I compress and decompress and check for integrity an load by hand etc. myself, so I can''t just use a standard SDL_LoadBMP("blah.bmp");. Anyone know how I would do this?

"There is no dark side of the moon really,
As a matter of fact, its all dark."

Share this post


Link to post
Share on other sites
Advertisement
www.wotsit.org

You should be able to find the specs for the .bmp format there. Just load all the .bmp info into a dynamically allocated SDL_Surface, and return a pointer to it. (I think )




[edited by - Xanth on January 18, 2003 12:47:37 PM]

Share this post


Link to post
Share on other sites
Yes. You must implement a SDL_RWops structure. This structure holds your custom functions for reading or writing data from a storage place (which doesn''t need to be a file). Then use SDL_LoadBMP_RW to load the bitmap using your custom compression algorithms.

Note that if you implement the SDL_RWops thing, you can load all kind of images using the SDL_Image library which is SDL_RWops compatible. This means you can use the same compression algorithm to compress bmp files or tga files or whatever, and the loading is still handled by SDL_image.

Share this post


Link to post
Share on other sites

  • 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!