V0 tomluchowski 14.x - #1
Conversation
|
This PR is requirement for tomluchowski/OpenDungeonsPlus#15 |
|
Heads-up from the OpenDungeonsPlus port work (tomluchowski/OpenDungeonsPlus#15), since Nested auto rendering surfaces render nothing in the Ogre renderer. Any widget with Reproduced with the sliders in OpenDungeons' Verified against this branch ( 🤖 Generated with Claude Code |
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>
|
Update: found the root cause and fixed it — slapin#1 (stacked on this PR's branch). It's a hidden-virtual: the draw-mode merge gave 🤖 Generated with Claude Code |
Make nested rendering surfaces (AutoRenderingSurface) composite again
Scissor testing was disabled wholesale in the Ogre geometry buffer (d8c7290) because the scissor rectangle CEGUI left enabled after its draw was clipping the render-to-texture work OpenDungeons does afterwards, breaking its generated large textures. But with the test disabled nothing clips at all: scrollable-pane content paints right across the pane border, over the scrollbars and over whatever sits under the pane, which is exactly what the OpenDungeons settings window has been showing. Turn the scissor test back on for batches that ask for clipping, and add the state discipline that was actually missing: disable the scissor test again once the buffer has drawn its batches, so no enabled scissor rectangle ever outlives the CEGUI draw and later Ogre render passes start from a clean state. Verified with OpenDungeons against Ogre 14.6 (GL3+): the settings window now clips its video options at the pane edge instead of painting them over the Apply/Cancel buttons, and the in-game HUD, drawn minimap and map editor (both render-to-texture users) are unaffected. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014hrk8PiEUMgjYJnTxLF2PU
Ogre: clip geometry batches again, without leaking scissor state
Update to Ogre v14.x