Skip to content

render: context::current() returns a non-const context& - #196

Merged
igagis-bot merged 1 commit into
cppfw:mainfrom
igagis-bot:api/current-non-const
Nov 24, 2026
Merged

igagis-bot merged 1 commit into
cppfw:mainfrom
igagis-bot:api/current-non-const

Conversation

@igagis-bot

Copy link
Copy Markdown
Contributor

Summary

ruis::render::context::current() now returns context& instead of const context& (the context stack also holds non-const pointers).

Rendering mutates the active context (frame state, draw commands), so renderers must obtain a usable reference. Previously the only way was const_cast at every renderer call site (see the companion PR cppfw/ruis-render-vulkan). The context is owned by the code that created it, so returning a non-const reference is safe.

Source-compatible for existing callers (a non-const reference binds to const usages as before).

Test plan

  • Full monorepo rebuild: OK
  • Full test suite (utki/tml/r4/rasterimage/ruis/...): all pass
  • check-format-ruis: pass
  • Integration CI via the companion monorepo PR (pinning this head + the ruis-render-vulkan companion head)

Rendering mutates the active context (frame state, draw commands); renderers
must obtain a usable reference without const_cast. The context is owned by the
code that created it, so returning a non-const reference is safe.
@codecov

codecov Bot commented Nov 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 28.53%. Comparing base (1d2c949) to head (71729da).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #196   +/-   ##
=======================================
  Coverage   28.53%   28.53%           
=======================================
  Files         239      239           
  Lines        8943     8943           
  Branches     2785     2785           
=======================================
  Hits         2552     2552           
  Misses       6057     6057           
  Partials      334      334           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@igagis-bot
igagis-bot merged commit d4afac3 into cppfw:main Nov 24, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants