aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/UIClass.cpp5
-rw-r--r--src/UIClass.h18
-rw-r--r--src/gameHeader.h23
-rw-r--r--src/main.cpp17
4 files changed, 10 insertions, 53 deletions
diff --git a/src/UIClass.cpp b/src/UIClass.cpp
index 711440a..9cdf735 100644
--- a/src/UIClass.cpp
+++ b/src/UIClass.cpp
@@ -1,6 +1,7 @@
-#include "UIClass.h"
+#include <UIClass.h>
void UIClass::handleEvents(){
+ SDL_Event e;
while(SDL_PollEvent(&e)){
switch(e.type){
case SDL_QUIT:
@@ -18,4 +19,4 @@ void UIClass::handleEvents(){
break;
}
}
-} \ No newline at end of file
+}
diff --git a/src/UIClass.h b/src/UIClass.h
deleted file mode 100644
index 956dbb8..0000000
--- a/src/UIClass.h
+++ /dev/null
@@ -1,18 +0,0 @@
-#ifndef UICLASS_H
-#define UICLASS_H
-
-#include <iostream>
-#include <cstdlib>
-#include <SDL2/SDL.h>
-#include <SDL2/SDL_opengl.h>
-
-extern SDL_Event e;
-extern bool gameRunning;
-
-class UIClass{
- public:
- void handleEvents();
-
-};
-
-#endif //UICLASS_H \ No newline at end of file
diff --git a/src/gameHeader.h b/src/gameHeader.h
deleted file mode 100644
index f289527..0000000
--- a/src/gameHeader.h
+++ /dev/null
@@ -1,23 +0,0 @@
-///THIS FILE IS USED FOR VARIABLES THAT WILL BE ACCESED BY MULTIPLE CLASSES/FILES
-#include <iostream>
-#include <cstdlib>
-#include <SDL2/SDL.h>
-#include <SDL2/SDL_opengl.h>
-
-#include "UIClass.h" //This can access SDL_Event e, if it won't compile for you, move it down to right above the ui object definition I guess :P
-
-//SDL VARIABLES
-SDL_Window *window = NULL;
-SDL_Surface *renderSurface = NULL;
-SDL_GLContext mainGLContext = NULL;
-
-//WINODWS VARIABLES
-const float sh = SCREEN_HEIGHT;
-const float sw = SCREEN_WIDTH;
-bool gameRunning = true;
-SDL_Event e;
-
-//OTHER VARIABLES
-UIClass ui;
-
-//FUNCTIONS
diff --git a/src/main.cpp b/src/main.cpp
index f152963..78163db 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1,15 +1,12 @@
-#include <iostream>
-#include <cstdlib>
-#include <SDL2/SDL.h>
-#include <SDL2/SDL_opengl.h>
+#include <common.h>
-#define SCREEN_WIDTH 1280
-#define SCREEN_HEIGHT 720
-//#define FULLSCREEN
+SDL_Window *window = NULL;
+SDL_Surface *renderSurface = NULL;
+SDL_GLContext mainGLContext = NULL;
+bool gameRunning = true;
-#include "gameHeader.h"
-
+UIClass ui;
int main(int argc,char **argv){
//runs start-up procedures
@@ -20,7 +17,7 @@ int main(int argc,char **argv){
//Turn on double Buffering
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
//create the window
- window = SDL_CreateWindow("Independent Study v. Alpha -1.0", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, SCREEN_WIDTH, SCREEN_HEIGHT, SDL_WINDOW_SHOWN | SDL_WINDOW_OPENGL
+ window = SDL_CreateWindow("Independent Study v.0.1 alpha", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, SCREEN_WIDTH, SCREEN_HEIGHT, SDL_WINDOW_SHOWN | SDL_WINDOW_OPENGL
#ifdef FULLSCREEN
| SDL_WINDOW_FULLSCREEN
#endif // FULLSCREEN