mirror of
https://github.com/antopilo/Nuake.git
synced 2026-09-15 20:08:54 +03:00
Quake maps geometry batching
Rendering Optimization
This commit is contained in:
21
Editor/src/UIComponents/Viewport.cpp
Normal file
21
Editor/src/UIComponents/Viewport.cpp
Normal 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();
|
||||
}
|
||||
Reference in New Issue
Block a user