controller const correctness
This commit is contained in:
@@ -99,14 +99,14 @@ void Controller::onInput() {
|
|||||||
|
|
||||||
void Controller::onLoad() { editor_.UpdateScreen(); }
|
void Controller::onLoad() { editor_.UpdateScreen(); }
|
||||||
|
|
||||||
void Controller::doRender() {
|
void Controller::doRender() const {
|
||||||
SDL_RenderClear(sdl_renderer_.get());
|
SDL_RenderClear(sdl_renderer_.get());
|
||||||
ImGui::Render();
|
ImGui::Render();
|
||||||
ImGui_ImplSDLRenderer_RenderDrawData(ImGui::GetDrawData());
|
ImGui_ImplSDLRenderer_RenderDrawData(ImGui::GetDrawData());
|
||||||
SDL_RenderPresent(sdl_renderer_.get());
|
SDL_RenderPresent(sdl_renderer_.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Controller::onExit() {
|
void Controller::onExit() const {
|
||||||
ImGui_ImplSDLRenderer_Shutdown();
|
ImGui_ImplSDLRenderer_Shutdown();
|
||||||
ImGui_ImplSDL2_Shutdown();
|
ImGui_ImplSDL2_Shutdown();
|
||||||
ImGui::DestroyContext();
|
ImGui::DestroyContext();
|
||||||
@@ -148,7 +148,7 @@ void Controller::CreateRenderer() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Controller::CreateGuiContext() {
|
void Controller::CreateGuiContext() const {
|
||||||
// Create the ImGui and ImPlot contexts
|
// Create the ImGui and ImPlot contexts
|
||||||
ImGui::CreateContext();
|
ImGui::CreateContext();
|
||||||
|
|
||||||
|
|||||||
@@ -26,13 +26,13 @@ class Controller {
|
|||||||
void onEntry();
|
void onEntry();
|
||||||
void onInput();
|
void onInput();
|
||||||
void onLoad();
|
void onLoad();
|
||||||
void doRender();
|
void doRender() const;
|
||||||
void onExit();
|
void onExit() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void CreateWindow();
|
void CreateWindow();
|
||||||
void CreateRenderer();
|
void CreateRenderer();
|
||||||
void CreateGuiContext();
|
void CreateGuiContext() const;
|
||||||
inline void quit() { active_ = false; }
|
inline void quit() { active_ = false; }
|
||||||
friend int ::main(int argc, char **argv);
|
friend int ::main(int argc, char **argv);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user