2020-11-17 20:28:51 +01:00
|
|
|
#include "SDL.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
2021-11-20 00:03:24 +01:00
|
|
|
SDL_Surface* screen;
|
|
|
|
static int done = 0;
|
|
|
|
|
|
|
|
int main()
|
2020-11-17 20:28:51 +01:00
|
|
|
{
|
2021-11-20 00:03:24 +01:00
|
|
|
SDL_Event event;
|
|
|
|
if(SDL_Init(SDL_INIT_VIDEO) < 0) exit(0);
|
|
|
|
atexit(SDL_Quit);
|
|
|
|
screen = SDL_SetVideoMode(320, 200, 8, SDL_SWSURFACE);
|
|
|
|
while(!done)
|
|
|
|
{
|
|
|
|
while(SDL_PollEvent(&event))
|
|
|
|
{
|
|
|
|
switch(event.type)
|
|
|
|
{
|
|
|
|
case SDL_KEYDOWN:
|
|
|
|
case SDL_QUIT:
|
|
|
|
done=1;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-11-17 20:28:51 +01:00
|
|
|
}
|