aboutsummaryrefslogtreecommitdiff
path: root/gameloop/src/loopManager.cpp
blob: ef2decfbe4aeb36b287ff24038ce666876ee04f5 (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
37
#include "loopManager.h"
LoopManager::LoopManager(){
}
void LoopManager::processInput(){
	SDL_Event event;
	SDL_PollEvent(&event);
	switch(event.type){
		case SDL_QUIT:
			gameRunning = false;
			break;
		case SDL_KEYDOWN:
			if(event.key.keysym.sym == SDLK_ESCAPE){
				gameRunning = false;
			}
		break;
	}
}
void LoopManager::loop(){
	while(gameRunning){
		//processInput();
		//update();
		//render();
	}
	window.destroyWindow();
}
void LoopManager::setup(){
	gameRunning = window.initWindow();
}
void LoopManager::render(){
	if(gameRunning){
		SDL_SetRenderDrawColor(window.getRenderer(),255,0,0,255);
		SDL_RenderClear(window.getRenderer());
	}
}
void LoopManager::update(){

}