setup debug mode

This commit is contained in:
arthur.jamet
2021-06-04 15:50:22 +02:00
parent d7a65c7d45
commit 294d67de6a
3 changed files with 13 additions and 2 deletions
+2
View File
@@ -10,6 +10,8 @@ include_directories(bomberman sources)
add_subdirectory(${PROJECT_SOURCE_DIR}/lib/wal)
add_subdirectory(${PROJECT_SOURCE_DIR}/lib/Ray)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2")
if (EMSCRIPTEN)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -s USE_GLFW=3 -s ASSERTIONS=1 -s WASM=1 -s ASYNCIFY")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s USE_GLFW=3 -s ASSERTIONS=1 -s WASM=1 -s ASYNCIFY")
+7 -2
View File
@@ -20,8 +20,11 @@ namespace BBM
}),
_wal(wal),
_window(window),
_camera(Vector3f(), Vector3f(), Vector3f(0, 1, 0), 50, CAMERA_PERSPECTIVE)
{}
_camera(Vector3f(), Vector3f(), Vector3f(0, 1, 0), 50, CAMERA_PERSPECTIVE),
_debugMode(true)
{
this->_window.setFPS(this->FPS);
}
void RenderSystem::onSelfUpdate()
{
@@ -53,6 +56,8 @@ namespace BBM
drawable.drawable->setPosition(Vector2f(pos.position.x, pos.position.y));
drawable.drawable->drawOn(this->_window);
}
if (this->_debugMode)
this->_window.drawFPS(Vector2f());
this->_window.endDrawing();
}
+4
View File
@@ -22,8 +22,12 @@ namespace BBM
//! @brief The camera used to render.
RAY::Camera::Camera3D _camera;
//! @brief Defines if the debug informations must be displayed or not
bool _debugMode;
//! @brief Window framerate limit
static constexpr short FPS = 30;
public:
//! @brief A method called after all entities that this system manage has been updated.
//! @note render on screen here