Jump to content
  • Advertisement
Sign in to follow this  
MARS_999

SDL_Image loader

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

Advertisement
I don't understand your question. What is SDL's built-in pointer? Why would you want to send a void pointer to the function?

Also, what do you mean by send? Do you mean pass it as an argument? In that case, it doesn't make sense because the argument is the name of the bitmap to load.

In short, give us more details.

Share this post


Link to post
Share on other sites
I want to use SDL to load the various image file types, but I want to avoid the cost of using memcpy and lose any gains because of the copying back and forth, due to I am using PBO to stream the data and bypass the system memory copy. So I need to use the pointer the mapped buffer is using and have SDL use that for reading the pixel data. Hope this clears up the issue. AFAIK this isn't possible with SDL currently, but wanted to check.

Share this post


Link to post
Share on other sites
IMG_Load takes a file name. It loads the image into memory, presumably in a fairly efficient way (minimal number of copies, etc.). IMG_Load_RW takes an SDL_RWops* as it's argument, which must point to the image data. SDL_RWops can be files and memory areas by default, but it's very easy to customize them to point to arbitrary sources (zip files, network, etc.).

Read the documentation for SDL_rwops.
linky

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!