Nykos728  | Voila mon code pour tester cette fonction :
  Code :
 - #include <iostream>
 - #include <SDL.h>
 - using namespace std;
 - int main (int argc, char *argv[])
 - {
 -     Uint8 *r=NULL, *g=NULL, *b=NULL;
 -     Uint32 pixel=64000;
 -     SDL_PixelFormat *fmt=NULL;
 -     // initialize SDL video
 -     if ( SDL_Init( SDL_INIT_VIDEO ) < 0 )
 -     {
 -         printf( "Unable to init SDL: %s\n", SDL_GetError() );
 -         return 1;
 -     }
 -     // make sure SDL cleans up before exit
 -     atexit(SDL_Quit);
 -     // create a new window
 -     SDL_Surface* screen = SDL_SetVideoMode(640, 480, 32,SDL_HWSURFACE|SDL_DOUBLEBUF);
 -     if ( !screen )
 -     {
 -         printf("Unable to set 640x480 video: %s\n", SDL_GetError());
 -         return 1;
 -     }
 -     bool done = false;
 -     while (!done)
 -     {
 -         // message processing loop
 -         SDL_Event event;
 -         while (SDL_PollEvent(&event))
 -         {
 -             // check for messages
 -             switch (event.type)
 -             {
 -                 // exit if the window is closed
 -             case SDL_QUIT:
 -                 done = true;
 -                 break;
 -                 // check for keypresses
 -             case SDL_KEYDOWN:
 -                 {
 -                     // exit if ESCAPE is pressed
 -                     if (event.key.keysym.sym == SDLK_ESCAPE)
 -                         done = true;
 -                     break;
 -                 }
 -             } // end switch
 -         } // end of message processing
 -         SDL_Flip(screen);
 -     } // end main loop
 -     SDL_GetRGB(pixel,fmt,r,g,b);
 -     cout<<"format screen : "<<screen->format<<endl;
 -     printf("R : %s\nG : %s\nB : %s\n",r,g,b);
 -     cout<<"format : "<<fmt<<endl;
 -     // all is well ;)
 -     printf("Exited cleanly\n" );
 -     return 0;
 - }
 
  |  
 
   Et quand je le lance lors de la fermeture du programme il ferme mais avec erreur : Process terminated with status 3 (0 minutes, 1 seconds)
 Pourriez-vous m'expliquer ma ou mes erreurs svp.
   Merci    Message édité par Nykos728 le 30-08-2009 à 21:29:09
  |