Quake maps geometry batching

Rendering Optimization
This commit is contained in:
Antoine Pilote
2021-07-13 22:23:19 -04:00
parent 38ceae6fa9
commit 2b88ee09e3
23 changed files with 347 additions and 266 deletions

View File

@@ -28,6 +28,7 @@
#include "src/Scene/Components/WrenScriptComponent.h"
#include "src/Scene/Systems/QuakeMapBuilder.h"
#include "src/Scene/Components/LightComponent.h"
#include "UIComponents/Viewport.h"
namespace Nuake {
Ref<UI::UserInterface> userInterface;
@@ -53,7 +54,6 @@ namespace Nuake {
void EditorInterface::DrawViewport()
{
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0, 0));
std::string name = ICON_FA_GAMEPAD + std::string(" Scene");
if (ImGui::Begin(name.c_str()))
{
@@ -125,7 +125,6 @@ namespace Nuake {
ImGui::PopStyleVar();
}
ImGui::End();
}
static int selected = 0;

View File

@@ -0,0 +1,21 @@
#include "Viewport.h"
#include <src/Vendors/imgui/imgui.h>
Viewport::Viewport(const std::string& name, Ref<Nuake::Texture> texture)
{
Name = name;
Texture = texture;
}
void Viewport::Draw()
{
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0, 0));
if (ImGui::Begin(Name.c_str()))
{
ImGui::Image((void*)Texture->GetID(), ImGui::GetContentRegionAvail(), ImVec2(0, 1), ImVec2(1, 0));
}
ImGui::PopStyleVar();
ImGui::End();
}

View File

@@ -0,0 +1,13 @@
#pragma once
#include "Engine.h"
#include "src/Rendering/Textures/Texture.h"
class Viewport
{
public:
std::string Name = "";
Ref<Nuake::Texture> Texture;
Viewport(const std::string& name, Ref<Nuake::Texture> texture);
void Draw();
};