summaryrefslogtreecommitdiff
path: root/src/main.cpp
blob: 25d4cc4bcb91847c44177f1dd7c38bdd93b484de (plain)
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
33
34
35
36
#include "main.hpp"

int main()
{
	Window main;
	List L(main);
	Event e;

    Timer fps;

	while(e.gRun())
	{
        fps.Start();

		while(e.Poll())
		{
			if(e.gEventType() == SDL_QUIT)
				e.off();
			//else if(e.gEventType() == SDL_KEYDOWN)
			//	eventHandle(e.gEvent());
		}

		main.Clear();

		L.Place();
		L.Behavior();

		main.Render();
		
        if(fps.getTicks() < (1000 / 60))
            SDL_Delay((1000 / 60) - fps.getTicks());
	}

	main.Destroy();
	return 0;
}