diff --git a/.idea/.idea.Motherload/.idea/workspace.xml b/.idea/.idea.Motherload/.idea/workspace.xml
index 787edec..164e542 100644
--- a/.idea/.idea.Motherload/.idea/workspace.xml
+++ b/.idea/.idea.Motherload/.idea/workspace.xml
@@ -12,9 +12,14 @@
-
-
-
+
+
+
+
+
+
+
+
@@ -73,7 +78,7 @@
{
"keyToString": {
- "C++ Project.Game.executor": "Debug",
+ "C++ Project.Game.executor": "Run",
"RunOnceActivity.OpenProjectViewOnStart": "true",
"RunOnceActivity.ShowReadmeOnStart": "true",
"ignore.virus.scanning.warn.message": "true",
@@ -222,6 +227,8 @@
+
+
diff --git a/Engine/BaseGame.cpp b/Engine/BaseGame.cpp
index 9611a59..09d2d66 100644
--- a/Engine/BaseGame.cpp
+++ b/Engine/BaseGame.cpp
@@ -40,7 +40,7 @@ void BaseGame::InitializeGameEngine()
#endif
// Initialize SDL
- if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_GAMECONTROLLER | SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC/*| SDL_INIT_AUDIO*/) < 0)
+ if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_GAMECONTROLLER | SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC /*| SDL_INIT_AUDIO*/) < 0)
{
std::cerr << "BaseGame::Initialize( ), error when calling SDL_Init: " << SDL_GetError() << std::endl;
return;
diff --git a/Game/Game.vcxproj b/Game/Game.vcxproj
index a8fdbbb..19f9ab8 100644
--- a/Game/Game.vcxproj
+++ b/Game/Game.vcxproj
@@ -71,7 +71,7 @@
- C:\Users\Bram\Desktop\Programming 2\Exam\dae16-VerhulstBram\Game;C:\Users\Bram\Desktop\Programming 2\Exam\dae16-VerhulstBram\Engine\imgui;$(SolutionDir)\Libraries\SDLTtf\SDL2_ttf-2.20.2\include;$(SolutionDir)\Libraries\SDLMixer\SDL2_mixer-2.6.3\include;$(SolutionDir)\Libraries\SDLImage\SDL2_image-2.6.3\include;$(SolutionDir)\Libraries\SDLMain\SDL2-2.26.3\include;$(SolutionDir)\Engine;$(IncludePath)
+ $(SolutionDir)Game;$(SolutionDir)Engine\imgui;$(SolutionDir)\Libraries\SDLTtf\SDL2_ttf-2.20.2\include;$(SolutionDir)\Libraries\SDLMixer\SDL2_mixer-2.6.3\include;$(SolutionDir)\Libraries\SDLImage\SDL2_image-2.6.3\include;$(SolutionDir)\Libraries\SDLMain\SDL2-2.26.3\include;$(SolutionDir)\Engine;$(IncludePath)
$(SolutionDir)\x64\Debug;$(SolutionDir)\Libraries\SDLTtf\SDL2_ttf-2.20.2\lib\x64;$(SolutionDir)\Libraries\SDLMixer\SDL2_mixer-2.6.3\lib\x64;$(SolutionDir)\Libraries\SDLImage\SDL2_image-2.6.3\lib\x64;$(SolutionDir)\Libraries\SDLMain\SDL2-2.26.3\lib\x64;$(LibraryPath)
BuildCompile
@@ -496,6 +496,6 @@
$(TargetDir)
- C:\Users\Bram\Desktop\Programming 2\Exam\dae16-VerhulstBram\Game;C:\Users\Bram\Desktop\Programming 2\Exam\dae16-VerhulstBram\Engine\imgui;$(VC_IncludePath);$(WindowsSDK_IncludePath);
+ $(SolutionDir)Game;$(SolutionDir)Engine\imgui;$(VC_IncludePath);$(WindowsSDK_IncludePath);
\ No newline at end of file
diff --git a/Game/Game.vcxproj.filters b/Game/Game.vcxproj.filters
index e40b086..9b66999 100644
--- a/Game/Game.vcxproj.filters
+++ b/Game/Game.vcxproj.filters
@@ -69,6 +69,9 @@
Source Files
+
+ Source Files
+
@@ -122,5 +125,8 @@
Header Files
+
+ Header Files
+
\ No newline at end of file
diff --git a/Game/GroundTileTypeManager.h b/Game/GroundTileTypeManager.h
index 817b200..9562a99 100644
--- a/Game/GroundTileTypeManager.h
+++ b/Game/GroundTileTypeManager.h
@@ -54,4 +54,3 @@ private:
static GroundTileTypeManager* m_pInstance;
};
-
diff --git a/Game/Levels/World/WorldLevel.cpp b/Game/Levels/World/WorldLevel.cpp
index cf6ba0a..7a22797 100644
--- a/Game/Levels/World/WorldLevel.cpp
+++ b/Game/Levels/World/WorldLevel.cpp
@@ -72,6 +72,8 @@ WorldLevel::~WorldLevel() {
//delete m_pTextTexture;
}
void WorldLevel::Update(float elapsedSec) {
+ m_fps = 1 / elapsedSec;
+
int mouseX, mouseY;
SDL_GetMouseState(&mouseX, &mouseY);
m_mousePos = Vector2f { float(mouseX), float(mouseY) };
@@ -257,6 +259,10 @@ void WorldLevel::ProcessImGui() {
ImGui::EndMenu();
}
+ if (ImGui::BeginMenu(std::to_string(m_fps).c_str())) {
+ ImGui::EndMenu();
+ }
+
ImGui::EndMainMenuBar();
}
diff --git a/Game/Levels/World/WorldLevel.h b/Game/Levels/World/WorldLevel.h
index e6224e6..ed55c7d 100644
--- a/Game/Levels/World/WorldLevel.h
+++ b/Game/Levels/World/WorldLevel.h
@@ -29,6 +29,8 @@ public:
std::vector m_Rects;
private:
+ double m_fps{ 0.0f };
+
WorldGridManager m_gridManager {};
Player m_player;
Vector2f m_mousePos {};
diff --git a/Game/main.cpp b/Game/main.cpp
index 12645b8..ab3bf77 100644
--- a/Game/main.cpp
+++ b/Game/main.cpp
@@ -14,7 +14,7 @@ int SDL_main(int argv, char** args) {
new Button();
- auto pGame { new Game { Window { "Motherload - Verhulst, Bram - 1DAEGD16E", Viewport.x, Viewport.y } } };
+ auto pGame { new Game { Window { "Motherload - Verhulst, Bram - 1DAEGD16E", Viewport.x, Viewport.y, false} } };
pGame->Run();
delete pGame;