SDL_Image loader

Started by
3 comments, last by DaedalusOwnsYou 15 years, 9 months ago
Is there anyway to send in a void* to IMG_Load() vs. using SDL's built in pointer?
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.
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.
I may be misunderstanding the question but if your using a pointer its not copying...
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

This topic is closed to new replies.

Advertisement