diff --git a/src/doompanning.cc b/src/doompanning.cc index ba5615b..d5679c7 100644 --- a/src/doompanning.cc +++ b/src/doompanning.cc @@ -261,6 +261,7 @@ ControllerActions run_ui(ControllerContext &ctx) int doom_controller_loop(ControllerContext &ctx) { static constexpr ImVec4 clear_color = ImVec4(0.45f, 0.55f, 0.60f, 1.00f); + ControllerActions actions = {}; while (!ctx.quit) @@ -301,13 +302,15 @@ int doom_controller_loop(ControllerContext &ctx) ImGui::NewFrame(); actions = run_ui(ctx); - // TODO render dooms // Rendering - ImGui::Render(); - auto [r, g, b, a] = imvec4_to_rgba(clear_color); + const auto [r, g, b, a] = imvec4_to_rgba(clear_color); SDL_SetRenderDrawColor(ctx.renderer, r, g, b, a); SDL_RenderClear(ctx.renderer); + + // TODO render dooms + + ImGui::Render(); ImGui_ImplSDLRenderer_RenderDrawData(ImGui::GetDrawData()); SDL_RenderPresent(ctx.renderer); } diff --git a/src/dp_util.hpp b/src/dp_util.hpp index 7d49bf1..23e5c56 100644 --- a/src/dp_util.hpp +++ b/src/dp_util.hpp @@ -10,7 +10,7 @@ #include "dp_types.h" -inline std::tuple imvec4_to_rgba(const ImVec4 &color) +inline constexpr std::tuple imvec4_to_rgba(const ImVec4 &color) { return { @@ -172,4 +172,4 @@ struct ExampleAppLog } }; -#endif // SRC_DP_UTIL_HPP \ No newline at end of file +#endif // SRC_DP_UTIL_HPP