From 566aa04cdacebfc95a8d76f51801965e5dadec4d Mon Sep 17 00:00:00 2001 From: MihailRis Date: Tue, 3 Feb 2026 23:13:07 +0300 Subject: [PATCH 01/11] test rendering ui to texture --- res/scripts/hud.lua | 2 ++ src/graphics/core/Framebuffer.cpp | 4 +++ src/graphics/core/Framebuffer.hpp | 4 ++- src/graphics/ui/elements/Frame.cpp | 42 ++++++++++++++++++++++++++++++ src/graphics/ui/elements/Frame.hpp | 18 +++++++++++++ src/graphics/ui/gui_xml.cpp | 11 ++++++++ 6 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 src/graphics/ui/elements/Frame.cpp create mode 100644 src/graphics/ui/elements/Frame.hpp diff --git a/res/scripts/hud.lua b/res/scripts/hud.lua index 322f03db5..a0e363b99 100644 --- a/res/scripts/hud.lua +++ b/res/scripts/hud.lua @@ -126,6 +126,8 @@ function on_hud_open() configure_SSAO() hud.default_hand_controller = update_hand + + gui.root.root:add("") end function on_hud_render() diff --git a/src/graphics/core/Framebuffer.cpp b/src/graphics/core/Framebuffer.cpp index bb360b54e..5d6be967d 100644 --- a/src/graphics/core/Framebuffer.cpp +++ b/src/graphics/core/Framebuffer.cpp @@ -89,6 +89,10 @@ Texture* Framebuffer::getTexture() const { return texture.get(); } +std::shared_ptr Framebuffer::getSharedTexture() const { + return texture; +} + uint Framebuffer::getWidth() const { return width; } diff --git a/src/graphics/core/Framebuffer.hpp b/src/graphics/core/Framebuffer.hpp index e48e97df4..4d21449c5 100644 --- a/src/graphics/core/Framebuffer.hpp +++ b/src/graphics/core/Framebuffer.hpp @@ -13,7 +13,7 @@ class Framebuffer : public Bindable { uint width; uint height; uint format; - std::unique_ptr texture; + std::shared_ptr texture; public: Framebuffer(uint fbo, uint depth, std::unique_ptr texture); Framebuffer(uint width, uint height, bool alpha=false); @@ -33,6 +33,8 @@ public: /// @brief Get framebuffer color attachment Texture* getTexture() const; + std::shared_ptr getSharedTexture() const; + /// @brief Get framebuffer width uint getWidth() const; /// @brief Get framebuffer height diff --git a/src/graphics/ui/elements/Frame.cpp b/src/graphics/ui/elements/Frame.cpp new file mode 100644 index 000000000..2a7af926b --- /dev/null +++ b/src/graphics/ui/elements/Frame.cpp @@ -0,0 +1,42 @@ +#include "Frame.hpp" + +#include "assets/Assets.hpp" +#include "graphics/core/Batch2D.hpp" +#include "graphics/core/Framebuffer.hpp" +#include "graphics/core/DrawContext.hpp" +#include "graphics/core/Texture.hpp" +#include "window/Window.hpp" +#include "../GUI.hpp" + +using namespace gui; + +static inline constexpr int MAX_TEXTURE_SIZE = 2048; + +gui::Frame::Frame(GUI& gui) : Container(gui, {}), fbo(nullptr) {} + +gui::Frame::~Frame() = default; + +void gui::Frame::draw(const DrawContext& pctx, const Assets& assets) { + glm::ivec2 size = getSize(); + if (size.x <= 0 || size.y <= 0 || + size.x > MAX_TEXTURE_SIZE || size.y > MAX_TEXTURE_SIZE) { + return; + } + auto& nonConstASsets = const_cast(assets); + if (fbo && (fbo->getWidth() != size.x || fbo->getHeight() != size.y)) { + fbo->resize(size.x, size.y); + nonConstASsets.store(fbo->getSharedTexture(), texture); + } else if (fbo == nullptr) { + fbo = std::make_unique(size.x, size.y, true); + nonConstASsets.store(fbo->getSharedTexture(), texture); + } + + // ui uses flipped camera with matrix based on main viewport + setPos({0, pctx.getViewport().y - size.y}); + + auto ctx = pctx.sub(); + ctx.setFramebuffer(fbo.get()); + display::clear(); + Container::draw(ctx, assets); + ctx.getBatch2D()->flush(); +} diff --git a/src/graphics/ui/elements/Frame.hpp b/src/graphics/ui/elements/Frame.hpp new file mode 100644 index 000000000..1f4a10c86 --- /dev/null +++ b/src/graphics/ui/elements/Frame.hpp @@ -0,0 +1,18 @@ +#pragma once + +#include "Container.hpp" + +class Framebuffer; + +namespace gui { + class Frame final : public Container { + public: + explicit Frame(GUI& gui); + virtual ~Frame(); + + void draw(const DrawContext& pctx, const Assets& assets) override; + private: + std::unique_ptr fbo; + std::string texture = "gui/no_icon"; + }; +} diff --git a/src/graphics/ui/gui_xml.cpp b/src/graphics/ui/gui_xml.cpp index 0020c28d1..f34bd9247 100644 --- a/src/graphics/ui/gui_xml.cpp +++ b/src/graphics/ui/gui_xml.cpp @@ -8,6 +8,7 @@ #include "elements/Button.hpp" #include "elements/Canvas.hpp" #include "elements/CheckBox.hpp" +#include "elements/Frame.hpp" #include "elements/Image.hpp" #include "elements/InlineFrame.hpp" #include "elements/InputBindBox.hpp" @@ -850,6 +851,15 @@ static std::shared_ptr read_page_box( return menu; } +static std::shared_ptr read_frame( + UiXmlReader& reader, const xml::xmlelement& element +) { + auto& gui = reader.getGUI(); + auto frame = std::make_shared(gui); + read_container_impl(reader, element, *frame, true); + return frame; +} + static std::shared_ptr read_iframe( UiXmlReader& reader, const xml::xmlelement& element ) { @@ -867,6 +877,7 @@ UiXmlReader::UiXmlReader(gui::GUI& gui, scriptenv&& env) contextStack.emplace(""); add("image", read_image); add("canvas", read_canvas); + add("frame", read_frame); add("iframe", read_iframe); add("label", read_label); add("panel", read_panel); From 30143292808e03b7200dcb763e8b575ef9637918 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Wed, 4 Feb 2026 00:13:41 +0300 Subject: [PATCH 02/11] update workflows --- .github/workflows/appimage.yml | 2 +- .github/workflows/macos.yml | 2 +- .github/workflows/windows-clang.yml | 2 +- .github/workflows/windows.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/appimage.yml b/.github/workflows/appimage.yml index 92c9d9fd6..c67ef2fe0 100644 --- a/.github/workflows/appimage.yml +++ b/.github/workflows/appimage.yml @@ -4,7 +4,7 @@ on: push: branches: [ "main", "release-**"] pull_request: - branches: [ "main", "dev" ] + branches: [ "main", "volume-renderer" ] workflow_call: inputs: build_name: diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 99466ddab..675966354 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -4,7 +4,7 @@ on: push: branches: [ "main", "release-**"] pull_request: - branches: [ "main", "dev" ] + branches: [ "main", "volume-renderer" ] workflow_call: inputs: build_name: diff --git a/.github/workflows/windows-clang.yml b/.github/workflows/windows-clang.yml index af0b060ae..384364368 100644 --- a/.github/workflows/windows-clang.yml +++ b/.github/workflows/windows-clang.yml @@ -4,7 +4,7 @@ on: push: branches: [ "main", "release-**"] pull_request: - branches: [ "main", "dev" ] + branches: [ "main", "volume-renderer" ] workflow_call: inputs: build_name: diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index d13479cd3..5f95321c7 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -4,7 +4,7 @@ on: push: branches: [ "main", "release-**"] pull_request: - branches: [ "main", "dev" ] + branches: [ "main", "volume-renderer" ] jobs: build-windows: From 463098aa1e22259385a8a7957851af7cd7c4da37 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Wed, 4 Feb 2026 13:10:49 +0300 Subject: [PATCH 03/11] add gui.create_frame --- res/scripts/hud.lua | 7 +++++- src/engine/Engine.cpp | 1 + src/graphics/ui/GUI.cpp | 20 +++++++++++++++ src/graphics/ui/GUI.hpp | 6 +++++ src/graphics/ui/elements/Frame.cpp | 33 +++++++++++++++++-------- src/graphics/ui/elements/Frame.hpp | 9 +++++-- src/graphics/ui/gui_xml.cpp | 11 --------- src/logic/scripting/lua/libs/libgui.cpp | 21 ++++++++++++++++ 8 files changed, 84 insertions(+), 24 deletions(-) diff --git a/res/scripts/hud.lua b/res/scripts/hud.lua index a0e363b99..d10d00e1e 100644 --- a/res/scripts/hud.lua +++ b/res/scripts/hud.lua @@ -127,7 +127,12 @@ function on_hud_open() hud.default_hand_controller = update_hand - gui.root.root:add("") + local name = "gui/no_icon" + gui.create_frame(name, {16, 16}) + + local document = Document.new(name) + document.root:add("") + document.root.color = {255, 0, 0, 255} end function on_hud_render() diff --git a/src/engine/Engine.cpp b/src/engine/Engine.cpp index 9afe0824a..70bb5dae9 100644 --- a/src/engine/Engine.cpp +++ b/src/engine/Engine.cpp @@ -305,6 +305,7 @@ void Engine::renderFrame() { screen->draw(time.getDelta()); DrawContext ctx(nullptr, *window, nullptr); + gui->renderFrames(ctx, *assets->getStorage()); gui->draw(ctx, *assets->getStorage()); } diff --git a/src/graphics/ui/GUI.cpp b/src/graphics/ui/GUI.cpp index d2702bb19..7677ca9f8 100644 --- a/src/graphics/ui/GUI.cpp +++ b/src/graphics/ui/GUI.cpp @@ -8,6 +8,7 @@ #include "elements/Label.hpp" #include "elements/Menu.hpp" #include "elements/Panel.hpp" +#include "elements/Frame.hpp" #include "elements/UINode.hpp" #include "engine/Engine.hpp" #include "frontend/UiDocument.hpp" @@ -262,6 +263,21 @@ void GUI::postAct() { } } +void GUI::renderFrames(const DrawContext& pctx, Assets& assets) { + auto ctx = pctx.sub(batch2D.get()); + + auto uishader = assets.get("ui"); + uishader->use(); + uishader->uniformMatrix("u_projview", uicamera->getProjView()); + + batch2D->begin(); + for (auto& [outputTexture, frame] : frames) { + frame->updateOutput(assets); + frame->draw(ctx, assets); + } + batch2D->flush(); +} + void GUI::draw(const DrawContext& pctx, const Assets& assets) { auto ctx = pctx.sub(batch2D.get()); @@ -337,6 +353,10 @@ void GUI::add(std::shared_ptr node) { container->add(std::move(node)); } +void GUI::addFrame(std::shared_ptr frame) { + frames[frame->getOutputTexture()] = std::move(frame); +} + void GUI::remove(UINode* node) noexcept { container->remove(node); } diff --git a/src/graphics/ui/GUI.hpp b/src/graphics/ui/GUI.hpp index a27872d76..b990d93ab 100644 --- a/src/graphics/ui/GUI.hpp +++ b/src/graphics/ui/GUI.hpp @@ -61,6 +61,7 @@ namespace gui { class UINode; class Container; class Menu; + class Frame; /// @brief The main UI controller class GUI { @@ -80,6 +81,7 @@ namespace gui { std::shared_ptr menu; std::queue postRunnables; std::vector> mouseOver; + std::unordered_map> frames; float tooltipTimer = 0.0f; float doubleClickTimer = 0.0f; @@ -112,6 +114,8 @@ namespace gui { /// @param viewport window size void act(float delta, const glm::uvec2& viewport); + void renderFrames(const DrawContext& pctx, Assets& assets); + /// @brief Draw all visible elements on main container /// @param pctx parent graphics context /// @param assets active assets storage @@ -123,6 +127,8 @@ namespace gui { /// @param node UI element void add(std::shared_ptr node); + void addFrame(std::shared_ptr frame); + /// @brief Remove node from the main container void remove(UINode* node) noexcept; diff --git a/src/graphics/ui/elements/Frame.cpp b/src/graphics/ui/elements/Frame.cpp index 2a7af926b..8f6840c9c 100644 --- a/src/graphics/ui/elements/Frame.cpp +++ b/src/graphics/ui/elements/Frame.cpp @@ -5,6 +5,7 @@ #include "graphics/core/Framebuffer.hpp" #include "graphics/core/DrawContext.hpp" #include "graphics/core/Texture.hpp" +#include "frontend/UiDocument.hpp" #include "window/Window.hpp" #include "../GUI.hpp" @@ -12,25 +13,23 @@ using namespace gui; static inline constexpr int MAX_TEXTURE_SIZE = 2048; -gui::Frame::Frame(GUI& gui) : Container(gui, {}), fbo(nullptr) {} +gui::Frame::Frame(GUI& gui, std::string outputTexture) + : Container(gui, {}), + fbo(nullptr), + outputTexture(std::move(outputTexture)) { +} gui::Frame::~Frame() = default; void gui::Frame::draw(const DrawContext& pctx, const Assets& assets) { + if (fbo == nullptr) { + return; + } glm::ivec2 size = getSize(); if (size.x <= 0 || size.y <= 0 || size.x > MAX_TEXTURE_SIZE || size.y > MAX_TEXTURE_SIZE) { return; } - auto& nonConstASsets = const_cast(assets); - if (fbo && (fbo->getWidth() != size.x || fbo->getHeight() != size.y)) { - fbo->resize(size.x, size.y); - nonConstASsets.store(fbo->getSharedTexture(), texture); - } else if (fbo == nullptr) { - fbo = std::make_unique(size.x, size.y, true); - nonConstASsets.store(fbo->getSharedTexture(), texture); - } - // ui uses flipped camera with matrix based on main viewport setPos({0, pctx.getViewport().y - size.y}); @@ -40,3 +39,17 @@ void gui::Frame::draw(const DrawContext& pctx, const Assets& assets) { Container::draw(ctx, assets); ctx.getBatch2D()->flush(); } + +void gui::Frame::updateOutput(Assets& assets) { + if (fbo && (fbo->getWidth() != size.x || fbo->getHeight() != size.y)) { + fbo->resize(size.x, size.y); + assets.store(fbo->getSharedTexture(), outputTexture); + } else if (fbo == nullptr) { + fbo = std::make_unique(size.x, size.y, true); + assets.store(fbo->getSharedTexture(), outputTexture); + } +} + +const std::string& gui::Frame::getOutputTexture() const { + return outputTexture; +} diff --git a/src/graphics/ui/elements/Frame.hpp b/src/graphics/ui/elements/Frame.hpp index 1f4a10c86..fc61b37a2 100644 --- a/src/graphics/ui/elements/Frame.hpp +++ b/src/graphics/ui/elements/Frame.hpp @@ -3,16 +3,21 @@ #include "Container.hpp" class Framebuffer; +class UiDocument; namespace gui { class Frame final : public Container { public: - explicit Frame(GUI& gui); + Frame(GUI& gui, std::string outputTexture); virtual ~Frame(); void draw(const DrawContext& pctx, const Assets& assets) override; + + void updateOutput(Assets& assets); + + const std::string& getOutputTexture() const; private: std::unique_ptr fbo; - std::string texture = "gui/no_icon"; + std::string outputTexture; }; } diff --git a/src/graphics/ui/gui_xml.cpp b/src/graphics/ui/gui_xml.cpp index f34bd9247..0020c28d1 100644 --- a/src/graphics/ui/gui_xml.cpp +++ b/src/graphics/ui/gui_xml.cpp @@ -8,7 +8,6 @@ #include "elements/Button.hpp" #include "elements/Canvas.hpp" #include "elements/CheckBox.hpp" -#include "elements/Frame.hpp" #include "elements/Image.hpp" #include "elements/InlineFrame.hpp" #include "elements/InputBindBox.hpp" @@ -851,15 +850,6 @@ static std::shared_ptr read_page_box( return menu; } -static std::shared_ptr read_frame( - UiXmlReader& reader, const xml::xmlelement& element -) { - auto& gui = reader.getGUI(); - auto frame = std::make_shared(gui); - read_container_impl(reader, element, *frame, true); - return frame; -} - static std::shared_ptr read_iframe( UiXmlReader& reader, const xml::xmlelement& element ) { @@ -877,7 +867,6 @@ UiXmlReader::UiXmlReader(gui::GUI& gui, scriptenv&& env) contextStack.emplace(""); add("image", read_image); add("canvas", read_canvas); - add("frame", read_frame); add("iframe", read_iframe); add("label", read_label); add("panel", read_panel); diff --git a/src/logic/scripting/lua/libs/libgui.cpp b/src/logic/scripting/lua/libs/libgui.cpp index fe4cabada..c71eb7e80 100644 --- a/src/logic/scripting/lua/libs/libgui.cpp +++ b/src/logic/scripting/lua/libs/libgui.cpp @@ -16,6 +16,7 @@ #include "graphics/ui/elements/TrackBar.hpp" #include "graphics/ui/elements/InlineFrame.hpp" #include "graphics/ui/elements/ModelViewer.hpp" +#include "graphics/ui/elements/Frame.hpp" #include "graphics/ui/gui_util.hpp" #include "graphics/ui/markdown.hpp" #include "graphics/core/Font.hpp" @@ -1149,6 +1150,25 @@ static int l_set_syntax_styles(lua::State* L) { return 0; } +static int l_create_frame(lua::State* L) { + if (engine->isHeadless()) { + return 0; + } + std::string outputTexture = lua::require_string(L, 1); + auto size = lua::tovec2(L, 2); + + auto& gui = engine->getGUI(); + auto frame = std::make_shared(gui, outputTexture); + frame->setSize(std::move(size)); + auto& assets = *engine->getAssets(); + auto document = std::make_shared( + outputTexture, UiDocScript {}, frame, nullptr + ); + assets.store(document, document->getId()); + gui.addFrame(std::move(frame)); + return 0; +} + const luaL_Reg guilib[] = { {"get_viewport", lua::wrap}, {"getattr", lua::wrap}, @@ -1162,6 +1182,7 @@ const luaL_Reg guilib[] = { {"alert", lua::wrap}, {"load_document", lua::wrap}, {"set_syntax_styles", lua::wrap}, + {"create_frame", lua::wrap}, {"__reindex", lua::wrap}, {nullptr, nullptr} }; From 8468ab184d02baeeac9e09e65a03647e6f4e8d9f Mon Sep 17 00:00:00 2001 From: MihailRis Date: Fri, 6 Feb 2026 14:16:30 +0300 Subject: [PATCH 04/11] add gui.get_active_frame, set_active_frame & update cursor lock behavior --- res/scripts/hud.lua | 6 +-- res/scripts/stdlib.lua | 2 + src/engine/Engine.cpp | 4 +- src/frontend/hud.cpp | 10 ++-- src/frontend/screens/LevelScreen.cpp | 1 + src/graphics/ui/GUI.cpp | 71 +++++++++++++++---------- src/graphics/ui/GUI.hpp | 14 +++-- src/graphics/ui/elements/Frame.cpp | 15 +++++- src/graphics/ui/elements/Frame.hpp | 12 ++++- src/graphics/ui/gui_util.cpp | 3 ++ src/logic/scripting/lua/libs/libgui.cpp | 35 ++++++++++-- 11 files changed, 123 insertions(+), 50 deletions(-) diff --git a/res/scripts/hud.lua b/res/scripts/hud.lua index d10d00e1e..8529ef991 100644 --- a/res/scripts/hud.lua +++ b/res/scripts/hud.lua @@ -127,11 +127,11 @@ function on_hud_open() hud.default_hand_controller = update_hand - local name = "gui/no_icon" - gui.create_frame(name, {16, 16}) + local name = "misc/moon" + gui.create_frame(name, name, {128, 128}) local document = Document.new(name) - document.root:add("") + document.root:add("") document.root.color = {255, 0, 0, 255} end diff --git a/res/scripts/stdlib.lua b/res/scripts/stdlib.lua index 683f27e8a..8d6ac26c0 100644 --- a/res/scripts/stdlib.lua +++ b/res/scripts/stdlib.lua @@ -232,6 +232,7 @@ _GUI_ROOT = Document.new("core:root") _MENU = _GUI_ROOT.menu menu = _MENU gui.root = _GUI_ROOT +gui.main_frame_id = "core:main" do local status, err = pcall(function() @@ -435,6 +436,7 @@ function __vc_on_hud_open() if menu.page ~= "" then if not menu:back() then menu:reset() + gui.set_active_frame("") end elseif hud.is_inventory_open() then hud.close_inventory() diff --git a/src/engine/Engine.cpp b/src/engine/Engine.cpp index 70bb5dae9..4799e9d77 100644 --- a/src/engine/Engine.cpp +++ b/src/engine/Engine.cpp @@ -302,10 +302,12 @@ void Engine::startPauseLoop() { } void Engine::renderFrame() { + if (input->isCursorLocked() != (gui->getActiveFrame() == nullptr)) { + input->toggleCursor(); + } screen->draw(time.getDelta()); DrawContext ctx(nullptr, *window, nullptr); - gui->renderFrames(ctx, *assets->getStorage()); gui->draw(ctx, *assets->getStorage()); } diff --git a/src/frontend/hud.cpp b/src/frontend/hud.cpp index d33c67ec6..6f3593610 100644 --- a/src/frontend/hud.cpp +++ b/src/frontend/hud.cpp @@ -207,9 +207,6 @@ Hud::Hud(Engine& engine, LevelFrontend& frontend, Player& player) } Hud::~Hud() { - if (input.isCursorLocked()) { - input.toggleCursor(); - } // removing all controlled ui for (auto& element : elements) { onRemove(element); @@ -342,9 +339,6 @@ void Hud::update(bool visible) { if (!gui.isFocusCaught()) { processInput(visible); } - if ((isMenuOpen || inventoryOpen) == input.isCursorLocked()) { - input.toggleCursor(); - } if (blockUI) { voxel* vox = chunks.get(blockPos.x, blockPos.y, blockPos.z); @@ -395,6 +389,7 @@ void Hud::openInventory(bool playerInventory) { inventoryView->bind(inventory, &content); add(HudElement(HudElementMode::INVENTORY, inventoryDocument, inventoryView, false)); } + gui.setActiveFrame(GUI::CORE_MAIN); } std::shared_ptr Hud::openInventory( @@ -548,6 +543,7 @@ void Hud::closeInventory() { } } cleanup(); + gui.setActiveFrame(""); } void Hud::add(const HudElement& element, const dv::value& argsArray) { @@ -710,9 +706,11 @@ void Hud::setPause(bool pause) { if (!pause && menu.hasOpenPage()) { menu.reset(); + gui.setActiveFrame(""); } if (pause && !menu.hasOpenPage()) { menu.setPage("pause"); + gui.setActiveFrame(GUI::CORE_MAIN); } } diff --git a/src/frontend/screens/LevelScreen.cpp b/src/frontend/screens/LevelScreen.cpp index 0dd1894b0..dfeb1dfb4 100644 --- a/src/frontend/screens/LevelScreen.cpp +++ b/src/frontend/screens/LevelScreen.cpp @@ -56,6 +56,7 @@ LevelScreen::LevelScreen( auto& assets = *engine.getAssets(); auto menu = engine.getGUI().getMenu(); menu->reset(); + gui.setActiveFrame(""); auto player = level->players->get(localPlayer); assert(player != nullptr); diff --git a/src/graphics/ui/GUI.cpp b/src/graphics/ui/GUI.cpp index 7677ca9f8..73bf73e2c 100644 --- a/src/graphics/ui/GUI.cpp +++ b/src/graphics/ui/GUI.cpp @@ -1,10 +1,10 @@ #include "GUI.hpp" #include -#include #include #include "assets/Assets.hpp" +#include "debug/Logger.hpp" #include "elements/Label.hpp" #include "elements/Menu.hpp" #include "elements/Panel.hpp" @@ -27,13 +27,15 @@ #include #include +static debug::Logger logger("gui"); + using namespace gui; GUI::GUI(Engine& engine) : engine(engine), input(engine.getInput()), batch2D(std::make_unique(1024)), - container(std::make_shared(*this, glm::vec2(1000))) { + container(std::make_shared(*this, CORE_MAIN, "")) { container->setId("root"); uicamera = std::make_unique(glm::vec3(), engine.getWindow().getSize().y); @@ -64,6 +66,8 @@ GUI::GUI(Engine& engine) std::dynamic_pointer_cast(container), nullptr ); + addFrame(container); + activeFrame = container; } GUI::~GUI() = default; @@ -118,7 +122,9 @@ void GUI::updateTooltip(float delta) { } /// @brief Mouse related input and logic handling -void GUI::actMouse(float delta, const CursorState& cursor) { +void GUI::actMouse(Frame& frame, float delta, const CursorState& cursor) { + auto& state = frame.getState(); + float mouseDelta = glm::length(cursor.delta); doubleClicked = false; doubleClickTimer += delta + mouseDelta * 0.1f; @@ -158,13 +164,13 @@ void GUI::actMouse(float delta, const CursorState& cursor) { } for (auto it = mouseOver.begin(); it != mouseOver.end(); ) { - auto node = it->lock(); - if (node) { - if (node->isInside(cursor.pos)) { + auto mouseOverNode = it->lock(); + if (mouseOverNode) { + if (mouseOverNode->isInside(cursor.pos)) { ++it; continue; } - node->setMouseOver(false); + mouseOverNode->setMouseOver(false); } it = mouseOver.erase(it); } @@ -233,14 +239,16 @@ void GUI::actFocused() { void GUI::act(float delta, const glm::uvec2& vp) { container->setSize(vp); - container->act(delta); + for (auto& pair : frames) { + pair.second->act(delta); + } auto prevfocus = focus; updateTooltip(delta); const auto& cursor = input.getCursor(); - if (!cursor.locked) { - actMouse(delta, cursor); + if (!cursor.locked && activeFrame) { + actMouse(*activeFrame, delta, cursor); } else { if (hover) { hover->setMouseEnter(false); @@ -263,22 +271,7 @@ void GUI::postAct() { } } -void GUI::renderFrames(const DrawContext& pctx, Assets& assets) { - auto ctx = pctx.sub(batch2D.get()); - - auto uishader = assets.get("ui"); - uishader->use(); - uishader->uniformMatrix("u_projview", uicamera->getProjView()); - - batch2D->begin(); - for (auto& [outputTexture, frame] : frames) { - frame->updateOutput(assets); - frame->draw(ctx, assets); - } - batch2D->flush(); -} - -void GUI::draw(const DrawContext& pctx, const Assets& assets) { +void GUI::draw(const DrawContext& pctx, Assets& assets) { auto ctx = pctx.sub(batch2D.get()); auto& viewport = ctx.getViewport(); @@ -300,7 +293,10 @@ void GUI::draw(const DrawContext& pctx, const Assets& assets) { uishader->uniformMatrix("u_projview", uicamera->getProjView()); batch2D->begin(); - container->draw(ctx, assets); + for (auto& [outputTexture, frame] : frames) { + frame->updateOutput(assets); + frame->draw(ctx, assets); + } if (hover) { engine.getWindow().setCursor(hover->getCursor()); @@ -354,7 +350,26 @@ void GUI::add(std::shared_ptr node) { } void GUI::addFrame(std::shared_ptr frame) { - frames[frame->getOutputTexture()] = std::move(frame); + const auto& id = frame->getFrameId(); + frames[id] = std::move(frame); +} + +void GUI::setActiveFrame(const std::string& id) { + if (id.empty()) { + activeFrame = nullptr; + return; + } + const auto& found = frames.find(id); + if (found == frames.end()) { + logger.error() << "attempted to make non-existing frame '" << id + << "' as active"; + return; + } + activeFrame = found->second; +} + +std::shared_ptr GUI::getActiveFrame() const { + return activeFrame; } void GUI::remove(UINode* node) noexcept { diff --git a/src/graphics/ui/GUI.hpp b/src/graphics/ui/GUI.hpp index b990d93ab..ee3fc1cd5 100644 --- a/src/graphics/ui/GUI.hpp +++ b/src/graphics/ui/GUI.hpp @@ -68,7 +68,7 @@ namespace gui { Engine& engine; Input& input; std::unique_ptr batch2D; - std::shared_ptr container; + std::shared_ptr container; std::shared_ptr hover; std::shared_ptr pressed; std::shared_ptr focus; @@ -76,6 +76,7 @@ namespace gui { std::shared_ptr rootDocument; std::unique_ptr syntaxColorScheme; std::unordered_map> storage; + std::shared_ptr activeFrame; std::unique_ptr uicamera; std::shared_ptr menu; @@ -89,11 +90,12 @@ namespace gui { bool doubleClicked = false; bool debug = false; - void actMouse(float delta, const CursorState& cursor); + void actMouse(Frame& frame, float delta, const CursorState& cursor); void actFocused(); void updateTooltip(float delta); void resetTooltip(); public: + static inline std::string CORE_MAIN = "core:main"; static constexpr int CONTEXT_MENU_ZINDEX = 999; GUI(Engine& engine); @@ -114,12 +116,10 @@ namespace gui { /// @param viewport window size void act(float delta, const glm::uvec2& viewport); - void renderFrames(const DrawContext& pctx, Assets& assets); - /// @brief Draw all visible elements on main container /// @param pctx parent graphics context /// @param assets active assets storage - void draw(const DrawContext& pctx, const Assets& assets); + void draw(const DrawContext& pctx, Assets& assets); void postAct(); @@ -129,6 +129,10 @@ namespace gui { void addFrame(std::shared_ptr frame); + void setActiveFrame(const std::string& id); + + std::shared_ptr getActiveFrame() const; + /// @brief Remove node from the main container void remove(UINode* node) noexcept; diff --git a/src/graphics/ui/elements/Frame.cpp b/src/graphics/ui/elements/Frame.cpp index 8f6840c9c..41e928965 100644 --- a/src/graphics/ui/elements/Frame.cpp +++ b/src/graphics/ui/elements/Frame.cpp @@ -13,15 +13,20 @@ using namespace gui; static inline constexpr int MAX_TEXTURE_SIZE = 2048; -gui::Frame::Frame(GUI& gui, std::string outputTexture) +gui::Frame::Frame(GUI& gui, std::string id, std::string outputTexture) : Container(gui, {}), fbo(nullptr), outputTexture(std::move(outputTexture)) { + frameId = std::move(id); } gui::Frame::~Frame() = default; void gui::Frame::draw(const DrawContext& pctx, const Assets& assets) { + if (outputTexture.empty()) { + Container::draw(pctx, assets); + return; + } if (fbo == nullptr) { return; } @@ -53,3 +58,11 @@ void gui::Frame::updateOutput(Assets& assets) { const std::string& gui::Frame::getOutputTexture() const { return outputTexture; } + +const std::string& gui::Frame::getFrameId() const { + return frameId; +} + +gui::Frame::State& gui::Frame::getState() { + return state; +} diff --git a/src/graphics/ui/elements/Frame.hpp b/src/graphics/ui/elements/Frame.hpp index fc61b37a2..ec34a3c69 100644 --- a/src/graphics/ui/elements/Frame.hpp +++ b/src/graphics/ui/elements/Frame.hpp @@ -8,7 +8,10 @@ class UiDocument; namespace gui { class Frame final : public Container { public: - Frame(GUI& gui, std::string outputTexture); + struct State { + }; + + Frame(GUI& gui, std::string id, std::string outputTexture); virtual ~Frame(); void draw(const DrawContext& pctx, const Assets& assets) override; @@ -16,7 +19,14 @@ namespace gui { void updateOutput(Assets& assets); const std::string& getOutputTexture() const; + + const std::string& getFrameId() const; + + /// @brief Frame state is controlled in gui::GUI + State& getState(); private: + std::string frameId; + State state {}; std::unique_ptr fbo; std::string outputTexture; }; diff --git a/src/graphics/ui/gui_util.cpp b/src/graphics/ui/gui_util.cpp index 9eab2742d..6c240e601 100644 --- a/src/graphics/ui/gui_util.cpp +++ b/src/graphics/ui/gui_util.cpp @@ -78,6 +78,7 @@ void guiutil::alert( })); menu.addPage("", panel, true); menu.setPage(""); + gui.setActiveFrame(GUI::CORE_MAIN); } void guiutil::confirm( @@ -155,6 +156,7 @@ void guiutil::confirm( panel->refresh(); menu->addPage("", container, true); menu->setPage(""); + gui.setActiveFrame(GUI::CORE_MAIN); } void guiutil::confirm_with_memo( @@ -201,4 +203,5 @@ void guiutil::confirm_with_memo( panel->refresh(); menu->addPage("", panel, true); menu->setPage(""); + gui.setActiveFrame(GUI::CORE_MAIN); } diff --git a/src/logic/scripting/lua/libs/libgui.cpp b/src/logic/scripting/lua/libs/libgui.cpp index c71eb7e80..0d6292d7a 100644 --- a/src/logic/scripting/lua/libs/libgui.cpp +++ b/src/logic/scripting/lua/libs/libgui.cpp @@ -1154,21 +1154,44 @@ static int l_create_frame(lua::State* L) { if (engine->isHeadless()) { return 0; } - std::string outputTexture = lua::require_string(L, 1); - auto size = lua::tovec2(L, 2); + std::string id = lua::require_string(L, 1); + std::string outputTexture = lua::require_string(L, 2); + auto size = lua::tovec2(L, 3); auto& gui = engine->getGUI(); - auto frame = std::make_shared(gui, outputTexture); + auto frame = std::make_shared(gui, id, outputTexture); frame->setSize(std::move(size)); auto& assets = *engine->getAssets(); auto document = std::make_shared( - outputTexture, UiDocScript {}, frame, nullptr + id, UiDocScript {}, frame, nullptr ); - assets.store(document, document->getId()); + assets.store(document, id); gui.addFrame(std::move(frame)); return 0; } +static int l_set_active_frame(lua::State* L) { + if (engine->isHeadless()) { + return 0; + } + std::string id = lua::require_string(L, 1); + auto& gui = engine->getGUI(); + gui.setActiveFrame(id); + return 0; +} + +static int l_get_active_frame(lua::State* L) { + if (engine->isHeadless()) { + return 0; + } + auto& gui = engine->getGUI(); + auto frame = gui.getActiveFrame(); + if (frame == nullptr) { + return 0; + } + return lua::pushstring(L, frame->getId()); +} + const luaL_Reg guilib[] = { {"get_viewport", lua::wrap}, {"getattr", lua::wrap}, @@ -1183,6 +1206,8 @@ const luaL_Reg guilib[] = { {"load_document", lua::wrap}, {"set_syntax_styles", lua::wrap}, {"create_frame", lua::wrap}, + {"set_active_frame", lua::wrap}, + {"get_active_frame", lua::wrap}, {"__reindex", lua::wrap}, {nullptr, nullptr} }; From 8ee2edef5c00a16430a03430dc0dae112b4647b7 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Fri, 6 Feb 2026 17:31:07 +0300 Subject: [PATCH 05/11] update gui.create_frame return value --- res/scripts/hud.lua | 10 +++++---- res/scripts/stdlib.lua | 10 +++++++++ src/frontend/screens/LevelScreen.cpp | 2 +- src/graphics/ui/GUI.cpp | 4 ++-- src/logic/PlayerController.cpp | 32 ++++++++++++++++------------ 5 files changed, 37 insertions(+), 21 deletions(-) diff --git a/res/scripts/hud.lua b/res/scripts/hud.lua index 8529ef991..3bdb4d634 100644 --- a/res/scripts/hud.lua +++ b/res/scripts/hud.lua @@ -128,11 +128,13 @@ function on_hud_open() hud.default_hand_controller = update_hand local name = "misc/moon" - gui.create_frame(name, name, {128, 128}) + local frame = gui.create_frame(name, name, {128, 128}) + frame:add("") + frame.color = {255, 0, 0, 255} - local document = Document.new(name) - document.root:add("") - document.root.color = {255, 0, 0, 255} + input.add_callback('key:y', function () + gui.set_active_frame(name) + end) end function on_hud_render() diff --git a/res/scripts/stdlib.lua b/res/scripts/stdlib.lua index 8d6ac26c0..5b7cb8fd7 100644 --- a/res/scripts/stdlib.lua +++ b/res/scripts/stdlib.lua @@ -234,6 +234,14 @@ menu = _MENU gui.root = _GUI_ROOT gui.main_frame_id = "core:main" +local __gui_create_frame = gui.create_frame +function gui.create_frame(id, output, size) + __gui_create_frame(id, output, size) + + local document = Document.new(id) + return document.root, document +end + do local status, err = pcall(function() local default_styles = toml.parse(file.read( @@ -440,6 +448,8 @@ function __vc_on_hud_open() end elseif hud.is_inventory_open() then hud.close_inventory() + elseif gui.get_active_frame() then + gui.set_active_frame("") else hud.pause() end diff --git a/src/frontend/screens/LevelScreen.cpp b/src/frontend/screens/LevelScreen.cpp index dfeb1dfb4..acb3edf70 100644 --- a/src/frontend/screens/LevelScreen.cpp +++ b/src/frontend/screens/LevelScreen.cpp @@ -240,7 +240,7 @@ void LevelScreen::update(float delta) { auto menu = gui.getMenu(); bool inputLocked = - menu->hasOpenPage() || hud->isInventoryOpen() || gui.isFocusCaught(); + gui.getActiveFrame() || hud->isInventoryOpen() || gui.isFocusCaught(); bool paused = hud->isPause(); if (!paused) { world.updateTimers(delta); diff --git a/src/graphics/ui/GUI.cpp b/src/graphics/ui/GUI.cpp index 73bf73e2c..1efc1e1f8 100644 --- a/src/graphics/ui/GUI.cpp +++ b/src/graphics/ui/GUI.cpp @@ -129,7 +129,7 @@ void GUI::actMouse(Frame& frame, float delta, const CursorState& cursor) { doubleClicked = false; doubleClickTimer += delta + mouseDelta * 0.1f; - auto hover = container->getAt(cursor.pos); + auto hover = frame.getAt(cursor.pos); if (this->hover && this->hover != hover) { this->hover->setMouseEnter(false); } @@ -289,8 +289,8 @@ void GUI::draw(const DrawContext& pctx, Assets& assets) { uicamera->setAspectRatio(viewport.x / static_cast(viewport.y)); auto uishader = assets.get("ui"); - uishader->use(); uishader->uniformMatrix("u_projview", uicamera->getProjView()); + uishader->use(); batch2D->begin(); for (auto& [outputTexture, frame] : frames) { diff --git a/src/logic/PlayerController.cpp b/src/logic/PlayerController.cpp index 9de01404b..17c4fe23f 100644 --- a/src/logic/PlayerController.cpp +++ b/src/logic/PlayerController.cpp @@ -3,6 +3,7 @@ #include #include +#include #include "BlocksController.hpp" #include "content/Content.hpp" @@ -28,17 +29,19 @@ #include "window/input.hpp" #include "world/Level.hpp" -const float INTERACTION_RELOAD = 0.160f; -const float STEPS_SPEED = 2.2f; -const float CAM_SHAKE_OFFSET = 0.0075f; -const float CAM_SHAKE_OFFSET_Y = 0.031f; -const float CAM_SHAKE_SPEED = STEPS_SPEED; -const float CAM_SHAKE_DELTA_K = 10.0f; -const float ZOOM_SPEED = 16.0f; -const float CROUCH_ZOOM = 0.9f; -const float RUN_ZOOM = 1.1f; -const float C_ZOOM = 0.1f; -const float CROUCH_SHIFT_Y = -0.2f; +namespace { + const float INTERACTION_RELOAD = 0.160f; + const float STEPS_SPEED = 2.2f; + const float CAM_SHAKE_OFFSET = 0.0075f; + const float CAM_SHAKE_OFFSET_Y = 0.031f; + const float CAM_SHAKE_SPEED = STEPS_SPEED; + const float CAM_SHAKE_DELTA_K = 10.0f; + const float ZOOM_SPEED = 16.0f; + const float CROUCH_ZOOM = 0.9f; + const float RUN_ZOOM = 1.1f; + const float C_ZOOM = 0.1f; + const float CROUCH_SHIFT_Y = -0.2f; +} CameraControl::CameraControl(Player& player, const CameraSettings& settings) : player(player), @@ -249,17 +252,18 @@ void PlayerController::onFootstep(const Hitbox& hitbox) { } void PlayerController::updateFootsteps(float delta) { + const float pi = glm::pi(); auto hitbox = player.getHitbox(); if (hitbox && hitbox->grounded) { const glm::vec3& vel = hitbox->velocity; float f = glm::length(glm::vec2(vel.x, vel.z)); stepsTimer += delta * f * STEPS_SPEED; - if (stepsTimer >= M_PI) { - stepsTimer = fmod(stepsTimer, M_PI); + if (stepsTimer >= pi) { + stepsTimer = fmod(stepsTimer, pi); onFootstep(*hitbox); } } else { - stepsTimer = M_PI; + stepsTimer = pi; } } From 239ada8e3d6591052ff4cf681bc7e9743f6b7d27 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Fri, 6 Feb 2026 18:05:21 +0300 Subject: [PATCH 06/11] add cursorLocator argument to gui.set_active_frame --- res/scripts/hud.lua | 5 +++-- src/graphics/ui/GUI.cpp | 22 ++++++++++++++-------- src/graphics/ui/GUI.hpp | 5 ++++- src/logic/scripting/lua/libs/libgui.cpp | 16 +++++++++++++++- 4 files changed, 36 insertions(+), 12 deletions(-) diff --git a/res/scripts/hud.lua b/res/scripts/hud.lua index 3bdb4d634..365d02e43 100644 --- a/res/scripts/hud.lua +++ b/res/scripts/hud.lua @@ -130,10 +130,11 @@ function on_hud_open() local name = "misc/moon" local frame = gui.create_frame(name, name, {128, 128}) frame:add("") - frame.color = {255, 0, 0, 255} input.add_callback('key:y', function () - gui.set_active_frame(name) + gui.set_active_frame(name, function() + return input.get_mouse_pos() + end) end) end diff --git a/src/graphics/ui/GUI.cpp b/src/graphics/ui/GUI.cpp index 1efc1e1f8..6dcb19d90 100644 --- a/src/graphics/ui/GUI.cpp +++ b/src/graphics/ui/GUI.cpp @@ -123,13 +123,18 @@ void GUI::updateTooltip(float delta) { /// @brief Mouse related input and logic handling void GUI::actMouse(Frame& frame, float delta, const CursorState& cursor) { - auto& state = frame.getState(); - float mouseDelta = glm::length(cursor.delta); doubleClicked = false; doubleClickTimer += delta + mouseDelta * 0.1f; - auto hover = frame.getAt(cursor.pos); + auto cursorPos = cursor.pos; + if (cursorLocator) { + cursorPos = cursorLocator(); + if (activeFrame) { + cursorPos.y += activeFrame->getPos().y; + } + } + auto hover = frame.getAt(cursorPos); if (this->hover && this->hover != hover) { this->hover->setMouseEnter(false); } @@ -166,7 +171,7 @@ void GUI::actMouse(Frame& frame, float delta, const CursorState& cursor) { for (auto it = mouseOver.begin(); it != mouseOver.end(); ) { auto mouseOverNode = it->lock(); if (mouseOverNode) { - if (mouseOverNode->isInside(cursor.pos)) { + if (mouseOverNode->isInside(cursorPos)) { ++it; continue; } @@ -179,10 +184,10 @@ void GUI::actMouse(Frame& frame, float delta, const CursorState& cursor) { if (pressed == nullptr && this->hover) { pressed = hover; if (doubleClickTimer < doubleClickDelay) { - pressed->doubleClick(cursor.pos.x, cursor.pos.y); + pressed->doubleClick(cursorPos.x, cursorPos.y); doubleClicked = true; } else { - pressed->click(cursor.pos.x, cursor.pos.y); + pressed->click(cursorPos.x, cursorPos.y); } doubleClickTimer = 0.0f; if (focus && focus != pressed) { @@ -199,7 +204,7 @@ void GUI::actMouse(Frame& frame, float delta, const CursorState& cursor) { focus = nullptr; } } else if (!input.clicked(Mousecode::BUTTON_1) && pressed) { - pressed->mouseRelease(cursor.pos.x, cursor.pos.y); + pressed->mouseRelease(cursorPos.x, cursorPos.y); pressed = nullptr; } @@ -354,7 +359,8 @@ void GUI::addFrame(std::shared_ptr frame) { frames[id] = std::move(frame); } -void GUI::setActiveFrame(const std::string& id) { +void GUI::setActiveFrame(const std::string& id, vec2supplier cursorLocator) { + this->cursorLocator = std::move(cursorLocator); if (id.empty()) { activeFrame = nullptr; return; diff --git a/src/graphics/ui/GUI.hpp b/src/graphics/ui/GUI.hpp index ee3fc1cd5..7d120c9cc 100644 --- a/src/graphics/ui/GUI.hpp +++ b/src/graphics/ui/GUI.hpp @@ -83,6 +83,7 @@ namespace gui { std::queue postRunnables; std::vector> mouseOver; std::unordered_map> frames; + vec2supplier cursorLocator; float tooltipTimer = 0.0f; float doubleClickTimer = 0.0f; @@ -129,7 +130,9 @@ namespace gui { void addFrame(std::shared_ptr frame); - void setActiveFrame(const std::string& id); + void setActiveFrame( + const std::string& id, vec2supplier cursorLocator = nullptr + ); std::shared_ptr getActiveFrame() const; diff --git a/src/logic/scripting/lua/libs/libgui.cpp b/src/logic/scripting/lua/libs/libgui.cpp index 0d6292d7a..60f894bda 100644 --- a/src/logic/scripting/lua/libs/libgui.cpp +++ b/src/logic/scripting/lua/libs/libgui.cpp @@ -1175,8 +1175,22 @@ static int l_set_active_frame(lua::State* L) { return 0; } std::string id = lua::require_string(L, 1); + vec2supplier cursorLocator = nullptr; + if (lua::isfunction(L, 2)) { + auto lambda = lua::create_lambda(L); + cursorLocator = [lambda]() -> glm::vec2 { + auto table = lambda({}); + if (!table.isList()) { + throw std::runtime_error("invalid value returned from locator"); + } + glm::vec2 pos {}; + table.at(0).get(pos.x); + table.at(1).get(pos.y); + return pos; + }; + } auto& gui = engine->getGUI(); - gui.setActiveFrame(id); + gui.setActiveFrame(id, std::move(cursorLocator)); return 0; } From 965faebc7b7b26a38a635d8491c27332003dd4cc Mon Sep 17 00:00:00 2001 From: MihailRis Date: Fri, 6 Feb 2026 18:25:52 +0300 Subject: [PATCH 07/11] add gui.close_menu --- res/layouts/pages/pause.xml | 2 +- res/scripts/stdlib.lua | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/res/layouts/pages/pause.xml b/res/layouts/pages/pause.xml index 3e4427cae..fb26968ca 100644 --- a/res/layouts/pages/pause.xml +++ b/res/layouts/pages/pause.xml @@ -1,5 +1,5 @@ - + ") - - input.add_callback('key:y', function () - gui.set_active_frame(name, function() - return input.get_mouse_pos() - end) - end) end function on_hud_render() From 422f709e9285e866bf98bb0181d2427070e191b5 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Fri, 6 Feb 2026 23:20:52 +0300 Subject: [PATCH 10/11] revert "update workflows" This reverts commit 30143292808e03b7200dcb763e8b575ef9637918. --- .github/workflows/appimage.yml | 2 +- .github/workflows/macos.yml | 2 +- .github/workflows/windows-clang.yml | 2 +- .github/workflows/windows.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/appimage.yml b/.github/workflows/appimage.yml index c67ef2fe0..92c9d9fd6 100644 --- a/.github/workflows/appimage.yml +++ b/.github/workflows/appimage.yml @@ -4,7 +4,7 @@ on: push: branches: [ "main", "release-**"] pull_request: - branches: [ "main", "volume-renderer" ] + branches: [ "main", "dev" ] workflow_call: inputs: build_name: diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 675966354..99466ddab 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -4,7 +4,7 @@ on: push: branches: [ "main", "release-**"] pull_request: - branches: [ "main", "volume-renderer" ] + branches: [ "main", "dev" ] workflow_call: inputs: build_name: diff --git a/.github/workflows/windows-clang.yml b/.github/workflows/windows-clang.yml index 384364368..af0b060ae 100644 --- a/.github/workflows/windows-clang.yml +++ b/.github/workflows/windows-clang.yml @@ -4,7 +4,7 @@ on: push: branches: [ "main", "release-**"] pull_request: - branches: [ "main", "volume-renderer" ] + branches: [ "main", "dev" ] workflow_call: inputs: build_name: diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 5f95321c7..d13479cd3 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -4,7 +4,7 @@ on: push: branches: [ "main", "release-**"] pull_request: - branches: [ "main", "volume-renderer" ] + branches: [ "main", "dev" ] jobs: build-windows: From 7bb1f9f2ce74dde82f72329c3a9e2b9d5a988970 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Fri, 6 Feb 2026 23:22:59 +0300 Subject: [PATCH 11/11] cleanup --- src/graphics/ui/elements/Frame.cpp | 4 ---- src/graphics/ui/elements/Frame.hpp | 7 ------- 2 files changed, 11 deletions(-) diff --git a/src/graphics/ui/elements/Frame.cpp b/src/graphics/ui/elements/Frame.cpp index 41e928965..f99673f22 100644 --- a/src/graphics/ui/elements/Frame.cpp +++ b/src/graphics/ui/elements/Frame.cpp @@ -62,7 +62,3 @@ const std::string& gui::Frame::getOutputTexture() const { const std::string& gui::Frame::getFrameId() const { return frameId; } - -gui::Frame::State& gui::Frame::getState() { - return state; -} diff --git a/src/graphics/ui/elements/Frame.hpp b/src/graphics/ui/elements/Frame.hpp index ec34a3c69..40d88dff6 100644 --- a/src/graphics/ui/elements/Frame.hpp +++ b/src/graphics/ui/elements/Frame.hpp @@ -8,9 +8,6 @@ class UiDocument; namespace gui { class Frame final : public Container { public: - struct State { - }; - Frame(GUI& gui, std::string id, std::string outputTexture); virtual ~Frame(); @@ -21,12 +18,8 @@ namespace gui { const std::string& getOutputTexture() const; const std::string& getFrameId() const; - - /// @brief Frame state is controlled in gui::GUI - State& getState(); private: std::string frameId; - State state {}; std::unique_ptr fbo; std::string outputTexture; };