Make nested rendering surfaces (AutoRenderingSurface) composite again - #1
Merged
slapin merged 1 commit intoAug 14, 2026
Conversation
Widgets with AutoRenderingSurface=True rendered nothing: their content was drawn into the texture target, but the quad that composites that texture back onto the parent surface never reached a render queue. The draw-mode merge gave RenderingWindow::draw and GUIContext::draw a drawModeMask parameter but left the base virtuals argless, so the derived functions hid RenderingSurface::draw()/drawContent() instead of overriding them. Window::render's 'ctx.surface->draw()' therefore dispatched to the base implementation, which renders the queues into the texture and stops — the composite-quad logic only exists in RenderingWindow::draw(drawModeMask). The doc comment on RenderingSurface::draw already described the mask parameter the signature was missing. Give the base virtuals the drawModeMask parameter (defaulted to DrawModeMaskAll, so external callers are unaffected), which turns the derived functions into real overrides, and pass the mask through at the call sites. This also reconnects GUIContext::drawContent — the mouse cursor drawing — to virtual dispatch, which had been severed the same way. Verified against Ogre 14.6 with OpenDungeonsPlus: a slider with AutoRenderingSurface=True went from rendering nothing to rendering normally, and the stock (surfaceless) path is unchanged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Aug 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the silent-nothing rendering of widgets with
AutoRenderingSurface=Truethat I described in the comment on this PR's discussion (tomluchowski#1).Root cause — a C++ hidden-virtual, introduced by the draw-mode merge:
RenderingWindow::draw(uint32 drawModeMask)andGUIContext::draw(uint32)took the new mask parameter, but the baseRenderingSurface::draw()/drawContent()stayed argless. Different signature = the derived functions hide the base virtuals instead of overriding them. SoWindow::render'sctx.surface->draw()dispatched to plainRenderingSurface::draw(), which renders the widget's queues into the texture target and stops — the code that queues the composite quad back onto the parent surface only exists inRenderingWindow::draw(drawModeMask), which nothing ever reached. Content went into the texture; the texture never came back out. No error anywhere, because every function that ran, ran successfully.The doc comment on
RenderingSurface::drawalready describes the mask parameter ("will be checked against the supplied mask") — the merge kept the docs and dropped the signature.Fix — give the base virtuals the
drawModeMaskparameter (defaulted toDrawModeMaskAll, so existing callers likeSystem::renderAllGUIContextsare unaffected), making the derived functions real overrides, and pass the mask through at the two call sites (Window::render,GUIContext::draw). This also reconnectsGUIContext::drawContent— which draws the mouse cursor and was severed the same way — to virtual dispatch.Verified built from source against Ogre 14.6 (
2ebfcfd) and run under OpenDungeonsPlus: a slider withAutoRenderingSurface=True(the repro from the original report) goes from rendering nothing to rendering track-and-thumb normally, and the stock surfaceless path renders identically to before. With this fix,FrameWindow's stock default ofAutoRenderingSurface=Trueshould also be safe again.🤖 Generated with Claude Code