SDL Surface Array

I want to store all the surfaces in an array for efficiency. I have...
 
SDL_Surface *CharLib[30];

This dosen't work. Should I use A list of objects storing the surfaces as members,or is there a simpler way?

That code should work if you include SDL.h.

Using std::vector instead of array is probably easier because you don't have to know beforehand how many surfaces you going to have.
Last edited on
Unhandled exception at 0x779415de in SDL_Test.exe: 0xC0000005: Access violation reading location 0x00000004.

The SDL lib works well, just not this init.

I could just get the image data from a stored file, but blitting takes time for the task i want to do.
Last edited on
It's impossible to know where the problem is when we can't see the code.
Topic archived. No new replies allowed.