Question about 8bit palette and image loading method

Hi I’d like to know how SDL handles 8bit color depths.

I mean, let’s say I’m in a 8bit video mode and all the images
I have to load and display are in a .bmp indexed mode (not RGB)
also these images don’t have a common palette.

Can I safely ignore all of the palette things and just load and
display the images, or should I set the display colors in someway ?

Another question that maybe slightly OT:

When should I load all the images I need for a game or an app ?

  1. It’s better to load all the images (even the ones you are not
    going to use that much, like menus screen or scoreboard …)
    at the beginning of the application and free them at exit.

  2. It’s better to load an image only when you need it and free it
    as soon you’re done with it, even if you’re going to reuse it later.

  3. Just load and free when you’re done all the images that are used the
    less in the game/application, (menu screen, score screenn…, title)
    but keep in memory all the images you need in your game loop.

  4. what else ?

I’m sorry if I said something stupid, but I’m not that expert in such
things…

Thanks,
G.Gabriele

I mean, let’s say I’m in a 8bit video mode and all the images
I have to load and display are in a .bmp indexed mode (not RGB)
also these images don’t have a common palette.

Can I safely ignore all of the palette things and just load and
display the images, or should I set the display colors in someway ?

SDL blits are colour-preserving; that is, they try to map each pixel to the
closest colour in the destination surface. This isn’t always done in a very
clever (or efficient) way so it is best to use identical palettes for
your surfaces; that way no translation of the pixels is needed.
SDL_DisplayFormat() will help you with this.

When should I load all the images I need for a game or an app ?

that’s the sort of decisions a programmer has to make

I won’t tell you how to do it. Instead, think for yourself.
Consider the consequences. Write some code. Look at the results.
Repeat until happy