2020-11-16 19:42:03 +03:00
|
|
|
#include "SDL.h"
|
2020-11-18 10:53:16 +03:00
|
|
|
#include <stdlib.h>
|
2016-03-27 05:12:34 +03:00
|
|
|
|
2020-11-18 10:53:16 +03:00
|
|
|
SDL_Surface* screen;
|
|
|
|
static int done = 0;
|
2016-03-27 05:12:34 +03:00
|
|
|
|
2020-11-18 10:53:16 +03:00
|
|
|
int main()
|
2016-03-27 05:12:34 +03:00
|
|
|
{
|
2020-11-16 19:42:03 +03:00
|
|
|
SDL_Event event;
|
2020-11-18 10:53:16 +03:00
|
|
|
if(SDL_Init(SDL_INIT_VIDEO) < 0) exit(0);
|
2020-11-16 19:42:03 +03:00
|
|
|
atexit(SDL_Quit);
|
2020-11-18 10:53:16 +03:00
|
|
|
screen = SDL_SetVideoMode(320, 200, 8, SDL_SWSURFACE);
|
|
|
|
while (!done)
|
|
|
|
{
|
|
|
|
while (SDL_PollEvent(&event))
|
|
|
|
{
|
|
|
|
switch (event.type)
|
|
|
|
{
|
2020-11-16 19:42:03 +03:00
|
|
|
case SDL_KEYDOWN:
|
|
|
|
case SDL_QUIT:
|
|
|
|
done = 1;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2016-03-27 05:12:34 +03:00
|
|
|
}
|