Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ruis/render/context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.

using namespace ruis::render;

std::vector<const ruis::render::context*> ruis::render::context::cur_context_stack;
std::vector<ruis::render::context*> ruis::render::context::cur_context_stack;

context::context(
utki::shared_ref<ruis::render::native_window> native_window, //
Expand Down
6 changes: 4 additions & 2 deletions src/ruis/render/context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class context : public std::enable_shared_from_this<context>
friend class frame_buffer;

// Context destruction is rare, so removing from the middle of stack is rare, ok to use std::vector.
static std::vector<const context*> cur_context_stack;
static std::vector<context*> cur_context_stack;

protected:
utki::shared_ref<context> get_shared_ref()
Expand All @@ -57,8 +57,10 @@ class context : public std::enable_shared_from_this<context>
* @brief Get the currently active rendering context.
*
* The context stack is maintained by apply(). This returns the top of the stack.
* A non-const reference is returned because rendering mutates the active context
* (frame state, draw commands); the context is owned by the code that created it.
*/
static const context& current() noexcept
static context& current() noexcept
{
utki::assert(!cur_context_stack.empty(), SL);
return *cur_context_stack.back();
Expand Down
Loading