I need a suggestion on how to load multiple images in SDL. All of the games I did before for practice had 1-5 surfaces where I could load an image and move it around. Now lets assume I am making a typing tutor where every letter has its own pretty image. Does it mean I would have to load A B C D..... Z surfaces into the game such as:
SDL_Surface* A = NULL;
SDL_Surface* B= NULL;
SDL_Surface* C = NULL;
A = LoadImage("graphics/A.bmp");
B = LoadImage("graphics/B.bmp");
C = LoadImage("graphics/C.bmp");
Z = LoadImage("graphics/Z.bmp");
I know that for the example with alphabet I can just load one image and then cut it up like a sprite but what if I have 100 images that are completely idepandant. Creating 100 surfaces seems wrong. Is there a proper way of doing it?
I was thinking of making a map and loading a proper image path only when I request a specific image key but wouldnt it slow down my program?