Adding docking support through ImGui , Adding multiviewport support through ImGui, Moving header file back into the src directory , started building the editor, Added framebuffer to renderer.

BUG:
The framebuffer will not be displayed in the editor for some reason
This commit is contained in:
2022-10-22 13:27:23 +02:00
parent 463a9ff307
commit 29e715b92a
64 changed files with 8338 additions and 8223 deletions

View File

@ -0,0 +1,52 @@
#pragma once
#include <chrono>
#include <imgui.h>
struct EngineStatistics {
float frameTime;
uint32_t verts;
uint32_t DC;
long long lastSampleTime;
long long frames;
long long FPS;
};
extern EngineStatistics ES;
inline void PerfomanceSamplerInit(){
ES.frames = 0;
ES.lastSampleTime = 0;
ES.lastSampleTime = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::high_resolution_clock::now().time_since_epoch()).count();
}
inline void SamplePerformance(void) {
ES.frames++;
ES.DC = 0;
ES.verts = 0;
unsigned long long now = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::high_resolution_clock::now().time_since_epoch()).count();
unsigned long long MilliSecondsPast = now - ES.lastSampleTime;
if (MilliSecondsPast >= 1000) {
ES.frameTime = (float)1000 / ES.frames;
ES.FPS = ES.frames;
ES.frames = 0;
ES.lastSampleTime = now;
}
}
inline void ShowStats() {
ImGui::Begin("Statistics", false, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove);
ImGui::Text("FPS: %i", ES.FPS);
ImGui::Text("Frame Time: %f", ES.frameTime);
ImGui::Text("Verts: %i", ES.verts);
ImGui::Text("Draw Calls: %i", ES.DC);
ImGui::End();
}