aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile4
-rw-r--r--include/common.h1
-rw-r--r--src/main.cpp7
3 files changed, 6 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 13a7119..083b86b 100644
--- a/Makefile
+++ b/Makefile
@@ -3,10 +3,10 @@ FLAGS_WIN32 = -lopengl32 -lmingw32 #-lSDL2_Image
FLAGS = -m32 -Iinclude -Wall -Werror -lSDL2main -lSDL2
all:
- @g++ src/main.cpp src/UIClass.cpp src/Quest.cpp -o main $(FLAGS_LINUX) $(FLAGS)
+ @g++ src/main.cpp src/UIClass.cpp src/windowClass.cpp src/Quest.cpp -o main $(FLAGS_LINUX) $(FLAGS)
win32:
- @g++ -L lib/ src/main.cpp src/UIClass.cpp -o main.exe $(FLAGS_WIN32) $(FLAGS)
+ @g++ -L lib/ src/main.cpp src/UIClass.cpp src/windowClass.cpp src/Quest.cpp -o main.exe $(FLAGS_WIN32) $(FLAGS)
clean:
rm main*
diff --git a/include/common.h b/include/common.h
index db0824b..4b05e5d 100644
--- a/include/common.h
+++ b/include/common.h
@@ -8,6 +8,7 @@
#include <SDL2/SDL.h>
#include <SDL2/SDL_opengl.h>
#include <UIClass.h>
+#include <windowClass.h>
#define SCREEN_WIDTH 1280
#define SCREEN_HEIGHT 720
diff --git a/src/main.cpp b/src/main.cpp
index 78163db..9ce98a1 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -7,6 +7,7 @@ SDL_GLContext mainGLContext = NULL;
bool gameRunning = true;
UIClass ui;
+Window win;
int main(int argc,char **argv){
//runs start-up procedures
@@ -38,12 +39,10 @@ int main(int argc,char **argv){
**** GAMELOOP ****
**************************/
- glClearColor(1,1,1,0);
+ win.setupRender();
while(gameRunning){
- glClear(GL_COLOR_BUFFER_BIT);
- SDL_GL_SwapWindow(window);
-
ui.handleEvents();
+ win.render();
}
/**************************