--- /dev/null
+#ifndef UICLASS_H
+#define UICLASS_H
+
+#include <common.h>
+
+class UIClass {
+ public:
+ void handleEvents();
+};
+
+#endif // UICLASS_H
--- /dev/null
+#ifndef COMMON_H
+#define COMMON_H
+
+///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>
+
+#define SCREEN_WIDTH 1280
+#define SCREEN_HEIGHT 720
+//#define FULLSCREEN
+
+//SDL VARIABLES
+extern SDL_Window *window;
+extern SDL_Surface *renderSurface;
+extern SDL_GLContext mainGLContext;
+
+//WINODWS VARIABLES
+extern bool gameRunning;
+
+#endif // COMMON_H
-#include "UIClass.h"
+#include <UIClass.h>
void UIClass::handleEvents(){
+ SDL_Event e;
while(SDL_PollEvent(&e)){
switch(e.type){
case SDL_QUIT:
break;
}
}
-}
\ No newline at end of file
+}
+++ /dev/null
-#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
+++ /dev/null
-///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
-#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
//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