Performance sampler added
This commit is contained in:
		@ -7,6 +7,7 @@
 | 
			
		||||
#include "GUI.h"
 | 
			
		||||
#include "Util.h"
 | 
			
		||||
#include <entt/entt.hpp>
 | 
			
		||||
#include "../../BarinkEngine/src/PerfCounter.h"
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
* Define globals
 | 
			
		||||
@ -16,6 +17,7 @@ Scene scene;
 | 
			
		||||
BarinkEngine::Renderable* renderable;
 | 
			
		||||
BarinkEngine::SceneObject* object;
 | 
			
		||||
Entity cube;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
* Runs once at startup 
 | 
			
		||||
* - USe to initialize the game/sandbox/demo
 | 
			
		||||
@ -49,19 +51,11 @@ void Start() {
 | 
			
		||||
    auto AmbientLight = scene.AddEntity("AmbientLight");
 | 
			
		||||
    AmbientLight.AddComponent<BarinkEngine::LightComponent>();
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    renderer.Prepare(scene);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
bool showImGuiMetrics = false;
 | 
			
		||||
/*
 | 
			
		||||
* Runs every frame
 | 
			
		||||
* - Use to draw Immediate mode graphics (Not meant for HUD's )
 | 
			
		||||
@ -69,7 +63,7 @@ bool showImGuiMetrics = false;
 | 
			
		||||
void ImmediateGraphicsDraw() 
 | 
			
		||||
{
 | 
			
		||||
    // Show internal BarinkEngine stats
 | 
			
		||||
    ShowStats();
 | 
			
		||||
    EngineInstrumentation::ShowStats();
 | 
			
		||||
 | 
			
		||||
    ImGui::Begin("Scene view");
 | 
			
		||||
    auto group = scene.getReg().view<BarinkEngine::IdentifierComponent>();
 | 
			
		||||
@ -79,18 +73,12 @@ void ImmediateGraphicsDraw()
 | 
			
		||||
        
 | 
			
		||||
        });
 | 
			
		||||
    ImGui::End();
 | 
			
		||||
    
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    ImGui::ShowMetricsWindow();
 | 
			
		||||
 | 
			
		||||
    ImGui::Begin("Settings");
 | 
			
		||||
        
 | 
			
		||||
 | 
			
		||||
        if (ImGui::Button("ImGui Debug")) 
 | 
			
		||||
        {
 | 
			
		||||
            std::cout << "Click!" << std::endl;
 | 
			
		||||
            showImGuiMetrics = true;
 | 
			
		||||
        }
 | 
			
		||||
        ImGui::ShowMetricsWindow(&showImGuiMetrics);
 | 
			
		||||
 | 
			
		||||
        auto& a = cube.GetComponent<BarinkEngine::Render3DComponent>();
 | 
			
		||||
    
 | 
			
		||||
        auto& b = cube.GetComponent<BarinkEngine::TransformComponent>();
 | 
			
		||||
@ -106,13 +94,9 @@ void ImmediateGraphicsDraw()
 | 
			
		||||
            ImGui::SliderFloat3("l-Color", &light.Color[0], 0.0f, 1.0f);
 | 
			
		||||
 | 
			
		||||
        });
 | 
			
		||||
       
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
    ImGui::End();
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
   
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
@ -120,9 +104,12 @@ void ImmediateGraphicsDraw()
 | 
			
		||||
* - Meant for game logic ( non-physics related) 
 | 
			
		||||
*/
 | 
			
		||||
void Update()
 | 
			
		||||
{
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Render() 
 | 
			
		||||
{
 | 
			
		||||
    renderer.Render(scene);
 | 
			
		||||
   
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
@ -131,4 +118,4 @@ void Update()
 | 
			
		||||
*/
 | 
			
		||||
void Stop()
 | 
			
		||||
{
 | 
			
		||||
}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user