From a27754596346d61aa8cc3ab74ff382e98339c680 Mon Sep 17 00:00:00 2001 From: Rtch90 Date: Sun, 8 Apr 2012 17:11:02 +0100 Subject: [PATCH] [Add] Added a Qt project for those silly IDE users. :D --- .gitignore | 2 ++ Bin/Makefile | 1 + LibDQt/LibDQt.pro | 33 +++++++++++++++++++++++++++++++++ src/Main/main.cpp | 20 +++++++++++--------- 4 files changed, 47 insertions(+), 9 deletions(-) create mode 100644 LibDQt/LibDQt.pro diff --git a/.gitignore b/.gitignore index 60be968..966e7b3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +LibDQt/LibDQt +LibDQt/Makefile LibD *.pro.user moc_* diff --git a/Bin/Makefile b/Bin/Makefile index 0501d3c..1236a2d 100644 --- a/Bin/Makefile +++ b/Bin/Makefile @@ -43,4 +43,5 @@ clean: $(MAKE) -C ../src/Sprite/ clean $(MAKE) -C ../src/IO/ clean $(MAKE) -C ../src/Global/ clean + rm -f *.log rm -f LibD diff --git a/LibDQt/LibDQt.pro b/LibDQt/LibDQt.pro new file mode 100644 index 0000000..289e866 --- /dev/null +++ b/LibDQt/LibDQt.pro @@ -0,0 +1,33 @@ +CONFIG -= qt +LIBS += -lGL \ + -lSDL \ + -lSDL_ttf \ + -lSDL_image \ + -lSDL_gfx \ + -ltinyxml \ + -lGLU +HEADERS += ../src/Actor/Player.h \ + ../src/Global/Globals.h \ + ../src/IO/Input.h \ + ../src/Main/Game.h \ + ../src/Main/LGLXWindow.h \ + ../src/Math/Timer.h \ + ../src/Math/MathBox.h \ + ../src/Math/FPS.h \ + ../src/Math/Vec2.h \ + ../src/Sprite/Sprite.h \ + ../src/System/Debug.h \ + ../src/Texture/Texture.h +SOURCES += ../src/Actor/Player.cpp \ + ../src/Global/Globals.cpp \ + ../src/IO/Input.cpp \ + ../src/Main/main.cpp \ + ../src/Main/LGLXWindow.cpp \ + ../src/Main/Game.cpp \ + ../src/Math/Vec2.cpp \ + ../src/Math/Timer.cpp \ + ../src/Math/FPS.cpp \ + ../src/Sprite/Sprite.cpp \ + ../src/System/Debug.cpp \ + ../src/Texture/Texture.cpp +OTHER_FILES += diff --git a/src/Main/main.cpp b/src/Main/main.cpp index e5b67fa..294ce05 100644 --- a/src/Main/main.cpp +++ b/src/Main/main.cpp @@ -18,15 +18,15 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR cmdLine, #else int main(int argc, char** argv) { #endif - // Start by opening a debug log. - Debug::openLog(true); - Debug::logger->message("\n ----- Engine Loading ------"); + // Start by opening a debug log. + Debug::openLog(true); + Debug::logger->message("\n ----- Engine Loading ------"); // Get our window settings. const int windowWidth = 800; const int windowHeight = 600; const int windowBPP = 16; const int windowFullscreen = false; - + #ifdef _WIN32 // This is our window. GLWindow programWindow(hInstance); @@ -35,14 +35,15 @@ int main(int argc, char** argv) { #endif // Our game code. Game game; - + // Attach our game to the window. programWindow.AttachGame(&game); - + // Attempt to create the window. if(!programWindow.Create(windowWidth, windowHeight, windowBPP, windowFullscreen)) { // If it fails. #ifdef _WIN32 + Debug::logger->message("Unable to create the OpenGL Window"); MessageBox(NULL, TEXT("Unable to create the OpenGL Window"), TEXT("An error occured"), MB_ICONERROR | MB_OK); #endif programWindow.Destroy(); // Reset the display and exit. @@ -50,6 +51,7 @@ int main(int argc, char** argv) { } if(!game.Init()) { // Initialize our game. #ifdef _WIN32 + Debug::logger->message("Could not initialize the application"); MessageBox(NULL, TEXT("Could not initialize the application"), TEXT("An error occured"), MB_ICONERROR | MB_OK); #endif programWindow.Destroy(); // Reset the display and exit. @@ -60,15 +62,15 @@ int main(int argc, char** argv) { programWindow.ProcessEvents(); // Process any window events. // We get the time that passed since the last frame. float elapsedTime = programWindow.GetElapsedSeconds(); - + game.Prepare(elapsedTime); // Do any pre-rendering logic. game.Render(); // Render the scene. - + programWindow.SwapBuffers(); } game.Shutdown(); // Free any resouces. Debug::closeLog(); programWindow.Destroy(); // Destroy the program window. - + return 0; }