#include #include #include #include class Viewport : public sophia::Panel { public: Viewport(sophia::UI& ui, sophia::RenderTargetHandle target) : Panel{{.name = "Viewport"}}, ui{ui}, target{target} {} void onUpdate(const sophia::FrameInfo&) override { ImGui::Text("Test ViewPort"); ui.image(target); } private: sophia::UI& ui; sophia::RenderTargetHandle target; }; class Testbed : public sophia::Application { public: Testbed() : Application{{.width = 750, .height = 1000, .name = "Testbed"}} {} void onCreate() override { sophia::RenderTargetHandle target = resources().create(); setSceneTarget(target); panels().emplace(ui(), target); } }; SOPHIA_MAIN(Testbed)