Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion SandboxRendering/SandboxRendering/Src/GameManagerSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
#include <Time/TimeWorldComponent.hpp>
#include <UI/ScreenSpaceTextComponent.hpp>

#include <imgui.h>

using namespace Poly;

void GameManagerSystem::CreateScene(Scene* scene)
Expand Down Expand Up @@ -153,7 +155,7 @@ void GameManagerSystem::CreatePBRShpereGrid(Scene* scene, Vector pos, Color albe
sphereTrans.SetLocalScale(Vector(1.0f, 1.0f, 1.0f) * 20.0f);
sphereTrans.SetLocalRotation(Quaternion(Vector::UNIT_Z, 90.0_deg));
// MeshRenderingComponent* meshCmp = DeferredTaskSystem::AddComponentImmediate<MeshRenderingComponent>(scene, sphere, "Models/Primitives/Sphere_HighPoly.obj", eResourceSource::GAME);
MeshRenderingComponent* meshCmp = DeferredTaskSystem::AddComponentImmediate<MeshRenderingComponent>(scene, sphere, "Models/Primitives/Sphere_LowPoly.obj", eResourceSource::GAME);
MeshRenderingComponent* meshCmp = DeferredTaskSystem::AddComponentImmediate<MeshRenderingComponent>(scene, sphere, "Models/Primitives/Sphere_HighPoly.obj", eResourceSource::GAME);
size_t materialsNum = meshCmp->GetMesh()->GetSubMeshes().GetSize();
for (size_t i = 0; i < materialsNum; ++i)
{
Expand Down Expand Up @@ -258,6 +260,8 @@ void GameManagerSystem::Update(Scene* scene)
UpdateParticles(scene);

UpdateLights(scene);

UpdateImguiWindow();

// UpdateModel(scene);

Expand All @@ -268,6 +272,21 @@ void GameManagerSystem::Update(Scene* scene)
// UpdatePostProcess(scene);
}

void GameManagerSystem::UpdateImguiWindow()
{
if (!ImGui::GetIO().Fonts->IsBuilt())
return;

gConsole.LogInfo("GameManagerSystem::UpdateImguiWindow()");

ImGui::Begin("Another Window");
ImGui::Text("Hello from another window!");
if (ImGui::Button("Click"))
gConsole.LogInfo("Another Window: Click");

ImGui::End();
}

void GameManagerSystem::UpdatePostProcess(Scene* scene)
{
float time = (float)(scene->GetWorldComponent<TimeWorldComponent>()->GetGameplayTime());
Expand Down
2 changes: 2 additions & 0 deletions SandboxRendering/SandboxRendering/Src/GameManagerSystem.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ namespace GameManagerSystem
ParticleComponent* SpawnEmitterHeartImpact2(Scene* world, Vector pos);
void SpawnHeartSystem(Scene* world);


void Update(Scene* world);
void UpdateImguiWindow();
void UpdateParticles(Scene* world);
void UpdateLights(Scene* world);
void UpdateModel(Scene* world);
Expand Down