current changes

This commit is contained in:
Julian
2021-05-21 14:07:53 +02:00
parent 945a6a8eea
commit 8d99108333
6 changed files with 46 additions and 16 deletions

View File

@@ -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} )

View File

@@ -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

View File

@@ -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));

View File

@@ -8,6 +8,8 @@
#include "DarkRP2D.h"
#include "Utility.h"
#include <GameEngine.h>
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()
{

View File

@@ -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)

View File

@@ -1,5 +1,4 @@
#ifndef UTILITY_H
#define UTILITY_H
#pragma once
#include <GL/glew.h>
#include <iostream>
@@ -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