[SDL] BMP is not drawed

sebastian at barfoot.mine.nu sebastian at barfoot.mine.nu
Thu Sep 8 00:08:44 PDT 2005


Thanks :) It works fine.

>
> 	Well, this time I think I know the answer :).
>
> 	the function should look like:
>
> 	int initgame(SDL_Surface **target) // Notice de *pointer to pointer*
> parametere!!!
> 	(...)
> 	*target = SDL_SetVideoMode(...); // the call to SDL_SetVideoMode
> will look like this
>
> 	otherwise, the pointer is not modified!
>
> 	Hope this time is the right answer.
>
> ++++++++++++++++++++++++++++++++
> ALBERT FERNANDEZ MARSAL
> CIRSA INTERACTIVE CORP. SL
> Analista senior y programador
> ++++++++++++++++++++++++++++++++
>
>
> -----Mensaje original-----
> De: sdl-bounces+afmarsal=cirsa.com at libsdl.org
> [mailto:sdl-bounces+afmarsal=cirsa.com at libsdl.org] En nombre de
> sebastian at barfoot.mine.nu
> Enviado el: jueves, 08 de septiembre de 2005 7:55
> Para: A list for developers using the SDL library. (includes SDL-announce)
> Asunto: Re: [SDL] BMP is not drawed
>
> Hmmm strange.
>
> I've got a header named main.h in this header is a function:
>
> ------------------------------------------------------------
> /* Diese Funktion initalisiert SDL und setzte den Videomodus. */
> int initgame(SDL_Surface *target) {
>    if (SDL_Init(SDL_INIT_VIDEO) < 0) {
>       fprintf(stderr, "SDL konnte nicht initialisiert werden: %s\n",
>                        SDL_GetError());
>       exit(1);
>    }
>
>    /* Videomodus setzen */
>    target = SDL_SetVideoMode(640, 480, 0, 0);
>    if (!target) {
>       fprintf(stderr, "Konnte Bildschirmmodus nicht setzen: %s\n",
>                        SDL_GetError());
>       exit(2);
>    }
>
>    /* Netzwerkunterstützung aktivieren */
>    if(SDLNet_Init() < 0) {
>       fprintf(stderr, "Konnte Netzwerk nicht initialisieren: %s\n",
> SDLNet_GetError());
>       exit(3);
>    }
>    return 0;
> }
>
> ---------------------------------------------------------------------
>
> It's called in main() with "initgame(screen)". If I use these funtion the
> screen stays black, no bmp is drawed. If I don't us the function and do
> write the orders in the function directly to main() the bmp is drawed. I
> can't say why.
>
> By the way do you know a good debugger for windows?
>
>
> _______________________________________________
> SDL mailing list
> SDL at libsdl.org
> http://www.libsdl.org/mailman/listinfo/sdl
>
>
> _______________________________________________
> SDL mailing list
> SDL at libsdl.org
> http://www.libsdl.org/mailman/listinfo/sdl
>










More information about the SDL mailing list