From 8d9910833340c5662ea8021b79a8f08c2650f4e6 Mon Sep 17 00:00:00 2001 From: Julian Date: Fri, 21 May 2021 14:07:53 +0200 Subject: [PATCH] current changes --- CMakeLists.txt | 9 +++++---- conanfile.txt | 3 +++ src/DarkRP2D.cpp | 1 - src/DesktopLauncher.cpp | 34 ++++++++++++++++++++++++++++++++-- src/Utility.cpp | 3 +-- src/Utility.h | 12 +++++------- 6 files changed, 46 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 27b63d2..7791ad1 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,6 +3,11 @@ project(DarkRP2D) set (CMAKE_CXX_STANDARD 11) include(ExternalProject) +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE Release) + add_definitions(-DNDEBUG) +endif(NOT CMAKE_BUILD_TYPE) + # Download automatically, you can also just copy the conan.cmake file if(NOT EXISTS "${CMAKE_BINARY_DIR}/conan.cmake") message(STATUS "Downloading conan.cmake from https://github.com/conan-io/cmake-conan") @@ -16,10 +21,6 @@ conan_cmake_run(CONANFILE conanfile.txt BASIC_SETUP CMAKE_TARGETS BUILD missing) -if(NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE Release) - add_definitions(-DNDEBUG) -endif(NOT CMAKE_BUILD_TYPE) MESSAGE( STATUS "PROJECT_SOURCE_DIR: " ${PROJECT_SOURCE_DIR} ) MESSAGE( STATUS "DarkRP2D_SOURCE_DIR: " ${DarkRP2D_SOURCE_DIR} ) diff --git a/conanfile.txt b/conanfile.txt index c100ac7..f5ece60 100644 --- a/conanfile.txt +++ b/conanfile.txt @@ -1,4 +1,5 @@ [requires] +GameEngine/0.0.1@gulum/stable box2d/2.3.1@conan/stable glm/0.9.9.1@g-truc/stable EntityX/1.1.2@gulum/stable @@ -7,9 +8,11 @@ sdl2/2.0.9@bincrafters/stable sdl2_image/2.0.4@bincrafters/stable glew/2.1.0@bincrafters/stable imgui/1.63@bincrafters/stable +vscodepropertiesgen/0.1@mkovalchik/stable [generators] cmake +VSCodeProperties [imports] bin, *.dll -> ./bin # Copies all dll files from packages bin folder to my "./" folder \ No newline at end of file diff --git a/src/DarkRP2D.cpp b/src/DarkRP2D.cpp index 8722bea..68597c0 100644 --- a/src/DarkRP2D.cpp +++ b/src/DarkRP2D.cpp @@ -80,7 +80,6 @@ void DarkRP2D::render(unsigned int delta) #ifndef NDEBUG ImGui_ImplSdlGL3_NewFrame(gWindow); #endif - //texttest Shader bitmapShader = assets->getShader("bitmapShader"); font->drawText(bitmapShader, "Hallo du noob", 25.0f, 25.0f, 1.f, glm::vec3(0.5f, 0.8f, 0.2f)); diff --git a/src/DesktopLauncher.cpp b/src/DesktopLauncher.cpp index b9407ca..5cea4b2 100755 --- a/src/DesktopLauncher.cpp +++ b/src/DesktopLauncher.cpp @@ -8,6 +8,8 @@ #include "DarkRP2D.h" #include "Utility.h" +#include + using namespace std; static SDL_Window *gWindow = NULL; @@ -17,7 +19,35 @@ static bool gameQuit = false; void dispose(); bool initSDL(); -int main(int argc, char *argv[]) +class DarkRP2DD : public GE::Application +{ + void create() override + { + + } + + virtual void update() override + { + + } + + virtual void render() override + { + + } + + virtual void resize() override + { + + } +}; + +GE::Application* CreateApplication() +{ + return new DarkRP2DD(); +} + +/*int main(int argc, char *argv[]) { //Init SDL_Window, SDL_Surface, SDL_Renderer if (!initSDL()) @@ -40,7 +70,7 @@ int main(int argc, char *argv[]) dispose(); return 0; -} +}*/ void Game::exit() { diff --git a/src/Utility.cpp b/src/Utility.cpp index 4332ad7..c34f76a 100644 --- a/src/Utility.cpp +++ b/src/Utility.cpp @@ -85,8 +85,6 @@ void Utility::Debug::ImGuiLogger::Draw(const char *title, bool *p_open) ImGui::End(); } -#endif //NDEBUG - void APIENTRY Utility::openglCallbackFunction(GLenum source, GLenum type, GLuint id, @@ -153,6 +151,7 @@ void APIENTRY Utility::openglCallbackFunction(GLenum source, break; } } +#endif //NDEBUG static const char *Errornames[] = {"OpenGL", "SDL", "GLEW", "Other"}; void Utility::printWarning(ERROR_TYPE type, std::string msg) diff --git a/src/Utility.h b/src/Utility.h index c77bf5c..a2bf7e8 100644 --- a/src/Utility.h +++ b/src/Utility.h @@ -1,5 +1,4 @@ -#ifndef UTILITY_H -#define UTILITY_H +#pragma once #include #include @@ -13,10 +12,10 @@ namespace Utility { -#ifndef NDEBUG + namespace Debug { - +#ifndef NDEBUG // Usage: // static ExampleAppLog my_log; // my_log.AddLog("Hello %d world\n", 123); @@ -45,9 +44,9 @@ struct ImGuiLogger }; extern ImGuiLogger openGLLogger; - -} // namespace Debug #endif //NDEBUG +} // namespace Debug + enum ERROR_TYPE { @@ -72,4 +71,3 @@ void printError(ERROR_TYPE type, std::string msg); void printInfo(ERROR_TYPE type, std::string msg); } // namespace Utility -#endif // UTILITY_H