mirror of
https://github.com/HowestDAE/dae16-VerhulstBram.git
synced 2025-12-16 12:21:48 +01:00
Add Imgui Navbar
This commit is contained in:
@@ -2,12 +2,15 @@
|
||||
#include "pch.h"
|
||||
#include "Game.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <ostream>
|
||||
|
||||
#include "colors.h"
|
||||
#include "utils.h"
|
||||
#include "WorldLevel.h"
|
||||
|
||||
Game::Game(const Window& window)
|
||||
: BaseGame { window }, m_Camera(Camera()), m_WorldLevel(WorldLevel(&m_Camera))
|
||||
: BaseGame { window }, m_Camera(Camera()), m_WorldLevel(WorldLevel(&m_Camera, GetViewPort()))
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
@@ -60,7 +63,6 @@ void Game::ProcessKeyDownEvent(const SDL_KeyboardEvent& e) {
|
||||
}
|
||||
|
||||
void Game::ProcessKeyUpEvent(const SDL_KeyboardEvent& e) {
|
||||
|
||||
}
|
||||
|
||||
void Game::ProcessMouseMotionEvent(const SDL_MouseMotionEvent& e) {
|
||||
@@ -71,26 +73,10 @@ void Game::ProcessMouseMotionEvent(const SDL_MouseMotionEvent& e) {
|
||||
void Game::ProcessMouseDownEvent(const SDL_MouseButtonEvent& e) {
|
||||
m_IsRightMouseDown = e.button == SDL_BUTTON_RIGHT;
|
||||
m_MouseOffset = Point2f{m_Camera.GetPosition().x - m_MousePos.x, m_Camera.GetPosition().y - m_MousePos.y};
|
||||
|
||||
|
||||
//std::cout << "MOUSEBUTTONDOWN event: ";
|
||||
//switch ( e.button )
|
||||
//{
|
||||
//case SDL_BUTTON_LEFT:
|
||||
// std::cout << " left button " << std::endl;
|
||||
// break;
|
||||
//case SDL_BUTTON_RIGHT:
|
||||
// std::cout << " right button " << std::endl;
|
||||
// break;
|
||||
//case SDL_BUTTON_MIDDLE:
|
||||
// std::cout << " middle button " << std::endl;
|
||||
// break;
|
||||
//}
|
||||
|
||||
}
|
||||
|
||||
void Game::ProcessMouseUpEvent(const SDL_MouseButtonEvent& e) {
|
||||
m_IsRightMouseDown = e.button == SDL_BUTTON_RIGHT;
|
||||
m_IsRightMouseDown = e.button == SDL_BUTTON_RIGHT ? false : m_IsRightMouseDown;
|
||||
//std::cout << "MOUSEBUTTONUP event: ";
|
||||
//switch ( e.button )
|
||||
//{
|
||||
@@ -106,11 +92,8 @@ void Game::ProcessMouseUpEvent(const SDL_MouseButtonEvent& e) {
|
||||
//}
|
||||
}
|
||||
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();
|
||||
|
||||
|
||||
|
||||
m_WorldLevel.ProcessImGui();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user