#pragma once #include #include #include #include #include #include "../editor_context.hpp" /** * Shows the active scene through its own active camera: what the game will * see. */ class GamePanel : public sophia::Panel { public: // Renders into `target` through `view`, a SceneView with no camera of its // own that this panel keeps pointed at the active scene. GamePanel(sophia::UI& ui, EditorContext& context, sophia::SceneViewRegistry& sceneViews, sophia::SceneViewHandle view, sophia::RenderTargetHandle target) : Panel{{.name = "Game", .windowFlags = ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoScrollWithMouse}}, ui{ui}, context{context}, sceneViews{sceneViews}, view{view}, target{target} {} void onUpdate(const sophia::FrameInfo& frameInfo) override; private: sophia::UI& ui; EditorContext& context; sophia::SceneViewRegistry& sceneViews; sophia::SceneViewHandle view; sophia::RenderTargetHandle target; };