|
@@ -1,43 +1,40 @@
|
|
|
+
|
|
|
#include <iostream>
|
|
|
-#include <SDL.h>
|
|
|
+#include <SDL/SDL.h>
|
|
|
|
|
|
-int main ( int argc, char** argv )
|
|
|
+int main()
|
|
|
{
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
if ( SDL_Init( SDL_INIT_VIDEO ) < 0)
|
|
|
{
|
|
|
- std::cout << "Impossible d'initialiser la SDL: " << SDL_GetError() << std::endl;
|
|
|
+ std::cout << "Can't initialize SDL: " << SDL_GetError() << std::endl;
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
atexit(SDL_Quit);
|
|
|
|
|
|
-
|
|
|
+
|
|
|
SDL_WM_SetCaption("Application SDL", 0);
|
|
|
|
|
|
-
|
|
|
-
|
|
|
- SDL_Surface* screen = SDL_SetVideoMode(640, 480, 16,
|
|
|
- SDL_HWSURFACE|SDL_DOUBLEBUF);
|
|
|
+
|
|
|
+
|
|
|
+ SDL_Surface* screen = SDL_SetVideoMode(640, 480, 32, SDL_HWSURFACE|SDL_DOUBLEBUF);
|
|
|
if ( !screen )
|
|
|
{
|
|
|
std::cout << "Unable to set 640x480 video: " << SDL_GetError() << std::endl;
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- bool done = false;
|
|
|
+
|
|
|
+ bool done(false);
|
|
|
while (!done)
|
|
|
{
|
|
|
-
|
|
|
+
|
|
|
SDL_Event event;
|
|
|
while (SDL_PollEvent(&event))
|
|
|
{
|
|
@@ -53,20 +50,20 @@ int main ( int argc, char** argv )
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
|
|
|
-
|
|
|
+
|
|
|
SDL_FillRect(screen, 0, SDL_MapRGB(screen->format, 0, 255, 255));
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
SDL_Flip(screen);
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
-
|
|
|
+
|
|
|
SDL_FreeSurface(screen);
|
|
|
|
|
|
-
|
|
|
- std::cout << "Aucune erreur détectée." << std::endl;
|
|
|
+ std::cout << "No error caught." << std::endl;
|
|
|
return 0;
|
|
|
}
|