Here's an example of a simple quick program (without any checks).
Code: Select all
#include <SDL2/SDL.h>
int main(int argc, char **argv)
{
SDL_Window *window = SDL_CreateWindow("Hello World!", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 640, 480, 0);
SDL_Event event;
while(1)
{
while(SDL_PollEvent(&event))
{
if (event.type == SDL_QUIT)
{
atexit(SDL_Quit);
return 0;
}
}
}
return 0;
}
I feel that I need to dig in the direction of thread, although I'm not completely sure. Any ideas?