3 #include <render/backend/RenderBackend.h>
10 explicit Viewport(glm::vec2i size_,
ColorRGB backgroundColor_ = {},
bool linearFiltering_ =
true);
14 Scene* addScene(
const std::string& name);
16 Scene* addScene(uuids::uuid uuid);
18 Scene* addScene(uuids::uuid uuid,
const std::string& name);
20 [[nodiscard]]
Scene* getScene(uuids::uuid sceneID);
22 [[nodiscard]]
const auto& getScenes()
const {
26 [[nodiscard]]
bool hasScene(uuids::uuid sceneID);
28 void removeScene(uuids::uuid sceneID);
30 void removeAllScenes();
37 for (
const auto& [uuid, scene] : this->scenes) {
38 if (
auto* camera = scene->getCamera()) {
45 [[nodiscard]]
ColorRGB getBackgroundColor()
const {
46 return this->backgroundColor;
49 void setBackgroundColor(
ColorRGB color) {
50 this->backgroundColor = color;
53 [[nodiscard]] glm::vec2i getSize()
const {
57 void setSize(glm::vec2i size_) {
59 this->recreateFrameBuffer();
62 [[nodiscard]]
bool isLinearFiltered()
const {
63 return this->linearFiltering;
66 void setLinearFiltering(
bool enable) {
67 this->linearFiltering = enable;
68 this->recreateFrameBuffer();
72 return &this->frameBufferHandle;
76 void recreateFrameBuffer();
79 std::unordered_map<uuids::uuid, std::unique_ptr<Scene>> scenes;