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*
#include <SDL2/SDL.h>
#include <SDL2/SDL_opengl.h>
#include <UIClass.h>
+#include <windowClass.h>
#define SCREEN_WIDTH 1280
#define SCREEN_HEIGHT 720
bool gameRunning = true;
UIClass ui;
+Window win;
int main(int argc,char **argv){
//runs start-up procedures
**** GAMELOOP ****
**************************/
- glClearColor(1,1,1,0);
+ win.setupRender();
while(gameRunning){
- glClear(GL_COLOR_BUFFER_BIT);
- SDL_GL_SwapWindow(window);
-
ui.handleEvents();
+ win.render();
}
/**************************