Library initialization

Hi, I have a question regarding the library initialization.


This initialize the SDL video and the SDL AUDIO. Okie.

But what if this fails ? How do I know if there is something
wrong with video or audio ?

I mean, is it possible to do somthing like:

if (SDL_Init (SDL_INIT_VIDEO) < 0)
/* couldn’t initialize, we exit … */

/* Video initialized, so we try to initialize sound /
I don’t know if this could be done. /
so is it possible to call SDL_Init more than once ? */

if (SDL_Init (SDL_INIT_AUDIO) < 0)
/* Audio doesn’t work, so we go on with out audio. */
audio_flag = DISABLE_AUDIO;

Is that ok ? or should I always do:
/* error ok, but what failed ? */

Ops, ehm another question :wink:

Why if the video is initialized in a 8bpp mode but the current
X Windows session is in 16bpp mode, the SDL program works in 16bpp
even if it has been initialized in 8bpp ? Shouldn’t it give
errors or loading images with a screwed palette ?


  • @G.Gabriele ---------------+
    | |
    ±----------------- think Open Source -+