From 02a836caeb3c2ec71b077d8aca3342b4dc509e36 Mon Sep 17 00:00:00 2001 From: scawful Date: Wed, 22 Jun 2022 23:13:42 -0400 Subject: [PATCH] controller const correctness --- src/app/core/controller.cc | 6 +++--- src/app/core/controller.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/app/core/controller.cc b/src/app/core/controller.cc index 035fd8c8..a730f0ef 100644 --- a/src/app/core/controller.cc +++ b/src/app/core/controller.cc @@ -99,14 +99,14 @@ void Controller::onInput() { void Controller::onLoad() { editor_.UpdateScreen(); } -void Controller::doRender() { +void Controller::doRender() const { SDL_RenderClear(sdl_renderer_.get()); ImGui::Render(); ImGui_ImplSDLRenderer_RenderDrawData(ImGui::GetDrawData()); SDL_RenderPresent(sdl_renderer_.get()); } -void Controller::onExit() { +void Controller::onExit() const { ImGui_ImplSDLRenderer_Shutdown(); ImGui_ImplSDL2_Shutdown(); ImGui::DestroyContext(); @@ -148,7 +148,7 @@ void Controller::CreateRenderer() { } } -void Controller::CreateGuiContext() { +void Controller::CreateGuiContext() const { // Create the ImGui and ImPlot contexts ImGui::CreateContext(); diff --git a/src/app/core/controller.h b/src/app/core/controller.h index 790f68f5..c0da842e 100644 --- a/src/app/core/controller.h +++ b/src/app/core/controller.h @@ -26,13 +26,13 @@ class Controller { void onEntry(); void onInput(); void onLoad(); - void doRender(); - void onExit(); + void doRender() const; + void onExit() const; private: void CreateWindow(); void CreateRenderer(); - void CreateGuiContext(); + void CreateGuiContext() const; inline void quit() { active_ = false; } friend int ::main(int argc, char **argv);