Question

So, I've tried searching online, but I didn't really find what I need.

Is there a way, in SDL2, to get an array of pixels from an image? ...after I get the array, I don't care anymore about the previous structure (SDL_Texture, SDL_Image, SDL_Surface, and so on) I just need the pixel array...how can I do that?

Thanks in advance!

Was it helpful?

Solution

You can load image as surface and get data from void *pixels; (it's member of SDL_Surface).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top