mirror of
https://github.com/HowestDAE/dae16-VerhulstBram.git
synced 2025-12-16 12:21:48 +01:00
Add Imgui, Add TextureManager
From 1.1k texture loads to 5
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
#include <imgui.h>
|
||||
#include "pch.h"
|
||||
#include "Game.h"
|
||||
|
||||
@@ -51,9 +52,7 @@ void Game::Update(float elapsedSec) {
|
||||
|
||||
void Game::Draw() const {
|
||||
utils::ClearBackground(Color4f(0.0f, 0.0f, 0.3f, 1.0f));
|
||||
//m_Camera.BeginRendering();
|
||||
m_WorldLevel.Draw();
|
||||
//m_Camera.EndRendering();
|
||||
}
|
||||
|
||||
void Game::ProcessKeyDownEvent(const SDL_KeyboardEvent& e) {
|
||||
@@ -61,20 +60,7 @@ void Game::ProcessKeyDownEvent(const SDL_KeyboardEvent& e) {
|
||||
}
|
||||
|
||||
void Game::ProcessKeyUpEvent(const SDL_KeyboardEvent& e) {
|
||||
//std::cout << "KEYUP event: " << e.keysym.sym << std::endl;
|
||||
//switch ( e.keysym.sym )
|
||||
//{
|
||||
//case SDLK_LEFT:
|
||||
// //std::cout << "Left arrow key released\n";
|
||||
// break;
|
||||
//case SDLK_RIGHT:
|
||||
// //std::cout << "`Right arrow key released\n";
|
||||
// break;
|
||||
//case SDLK_1:
|
||||
//case SDLK_KP_1:
|
||||
// //std::cout << "Key 1 released\n";
|
||||
// break;
|
||||
//}
|
||||
|
||||
}
|
||||
|
||||
void Game::ProcessMouseMotionEvent(const SDL_MouseMotionEvent& e) {
|
||||
@@ -119,3 +105,10 @@ void Game::ProcessMouseUpEvent(const SDL_MouseButtonEvent& e) {
|
||||
// break;
|
||||
//}
|
||||
}
|
||||
void Game::ProcessImGui() {
|
||||
ImGui::Begin("Hello world", nullptr, ImGuiWindowFlags_AlwaysAutoResize);
|
||||
ImGui::Text("Texture loading Count:");
|
||||
ImGui::SameLine();
|
||||
ImGui::TextColored(ImVec4(1.0f, 0.0f, 1.0f, 1.0f), std::to_string(Texture::m_TextureCounter).c_str());
|
||||
ImGui::End();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user