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