Files
sophia/editor/panels/game_panel.cpp
T

21 lines
503 B
C++

#include "game_panel.hpp"
#include <imgui.h>
void GamePanel::onUpdate(const sophia::FrameInfo&) {
syncSceneView(context, sceneViews, view, isShown());
if (!context.hasScene()) {
ImGui::TextDisabled("No scene open");
return;
}
const ImVec2 origin = ImGui::GetCursorScreenPos();
ui.image(target);
if (!context.getScene().getActiveCamera()) {
ImGui::SetCursorScreenPos(ImVec2(origin.x + 8.0f, origin.y + 8.0f));
ImGui::TextDisabled("The scene has no active camera");
}
}