How to get a screen stay

Hi to all.

I am very newbie using SDL. I just started today! :slight_smile:

Ok, this is my first question: i copy this simple code:

---- begin code ----
/*

  • Example1_SDL.c
    */

#include <stdlib.h>
#include “SDL.h”

int main(int argc, char *argv[])
{
SDL_Surface *screen;

/* Initialize the SDL library */
if( SDL_Init(SDL_INIT_VIDEO) < 0 )
{
fprintf(stderr, “Couldn’t initialize SDL: %s\n”, SDL_GetError());
exit(1);
}

/* Clean up on exit */
atexit(SDL_Quit);

/*

  • Initialize the display in a 640x480 8-bit palettized mode,
  • requesting a software surface
    */
    screen = SDL_SetVideoMode(640, 480, 8, SDL_SWSURFACE);
    if ( screen == NULL )
    {
    fprintf(stderr, “Couldn’t set 640x480x8 video mode: %s\n”,
    SDL_GetError());
    exit(1);
    }
    }
    ---- end code ----

I get compile it with gcc -I/usr/include/SDL -lSDL …
and when i run the program… i can see a screen (or
window) that is for a few seconds and after disappear.

What is the way for get the window or screen created
stay in the deskop and no disappear so quicky?. I am
looking lots of code examples, but by now i can’t get
find the right way of get it…

Thanks you, very much, in advance.

Regards.

Jose.

http://www.lordofunix.org

Registered Linux User #213309.
Memories… You are talking about memories.
Rick Deckard. Blade Runner.

Get your Free E-mail at http://tales.zzn.com___________________________________________________________
Get your own Web-based E-mail Service at http://www.zzn.com

What is the way for get the window or screen created
stay in the deskop and no disappear so quicky?. I am
looking lots of code examples, but by now i can’t get
find the right way of get it…

Don’t let the code exit right after it initializes the display. :wink:

–>Neil-------------------------------------------------------------------------------
Neil Bradley "Your mistletoe is no match for my T.O.W. missile!"
Synthcom Systems, Inc. - Santabot - Futurama
ICQ #29402898