]> code.bitgloo.com Git - clyne/gamedev.git/commitdiff
Hey
authorClyne Sullivan <tullivan99@gmail.com>
Mon, 7 Sep 2015 19:28:36 +0000 (15:28 -0400)
committerClyne Sullivan <tullivan99@gmail.com>
Mon, 7 Sep 2015 19:28:36 +0000 (15:28 -0400)
include/UIClass.h [new file with mode: 0644]
include/common.h [new file with mode: 0644]
src/UIClass.cpp
src/UIClass.h [deleted file]
src/gameHeader.h [deleted file]
src/main.cpp

diff --git a/include/UIClass.h b/include/UIClass.h
new file mode 100644 (file)
index 0000000..c5d74c3
--- /dev/null
@@ -0,0 +1,11 @@
+#ifndef UICLASS_H
+#define UICLASS_H
+
+#include <common.h>
+
+class UIClass {
+       public:
+               void handleEvents();
+};
+
+#endif // UICLASS_H
diff --git a/include/common.h b/include/common.h
new file mode 100644 (file)
index 0000000..db0824b
--- /dev/null
@@ -0,0 +1,24 @@
+#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
index 711440a742591f340b1f5530f5375dd07384d0d3..9cdf735c8c74e6d4eec170c56d5a80d716db5f50 100644 (file)
@@ -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 (file)
index 956dbb8..0000000
+++ /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 (file)
index f289527..0000000
+++ /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
index f152963a323c2b4c1f9e1f34011ea0064e68de6e..78163db2e0dd25d5ccf633c64eda67993db14ca0 100644 (file)
@@ -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