include SDL SDL include SDL SDL_draw int main int argc char argv SDL_S

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include <SDL/SDL.h>
#include <SDL/SDL_draw.h>
int main(int argc, char *argv[])
{
SDL_Surface *screen;
SDL_Event event;
if (SDL_Init(SDL_INIT_VIDEO))
return 1;
screen = SDL_SetVideoMode(640,480,32,
SDL_ANYFORMAT);
if (!screen)
{
SDL_Quit();
return 1;
}
Draw_FillEllipse(screen, 320, 240, 300, 200,
SDL_MapRGB(screen->format, 128, 128, 128));
SDL_Flip(screen);
while(SDL_WaitEvent(&event))
{
if(event.type == SDL_QUIT ||
(event.type == SDL_KEYDOWN &&
event.key.keysym.sym == SDLK_ESCAPE))
{
SDL_Quit();
return 0;
}
}
SDL_Quit();
return 2;
}