From b6e3cc840e255b78ee53e55b420aeee130e51ce1 Mon Sep 17 00:00:00 2001 From: Dominick Allen Date: Wed, 25 Sep 2024 10:53:18 -0500 Subject: Work on wrapping types. --- src/imgui_context.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/imgui_context.cpp') diff --git a/src/imgui_context.cpp b/src/imgui_context.cpp index d0f9206..f45b22b 100644 --- a/src/imgui_context.cpp +++ b/src/imgui_context.cpp @@ -1,5 +1,6 @@ #include "imgui_context.hpp" +#include #include #include @@ -17,6 +18,14 @@ ImguiContext::ImguiContext(GlContext& glContext, SdlContext& sdlContext, SdlMain ImGui::StyleColorsDark(); // ImGui::StyleColorsLight(); + auto& style = ImGui::GetStyle(); + style.WindowRounding = 0.0f;// <- Set this on init or use ImGui::PushStyleVar() + style.ChildRounding = 0.0f; + style.FrameRounding = 0.0f; + style.GrabRounding = 0.0f; + style.PopupRounding = 0.0f; + style.ScrollbarRounding = 0.0f; + ImGui_ImplSDL2_InitForOpenGL(mainWindow.window(), glContext.context()); ImGui_ImplOpenGL3_Init(sdlContext.glslVersion()); } @@ -52,6 +61,15 @@ void ImguiContext::startFrame() const void ImguiContext::render() const { + ImGui::Render(); + const auto& imguiIO = getIO(); + const auto width = static_cast(imguiIO.DisplaySize.x); + const auto height = static_cast(imguiIO.DisplaySize.y); + glViewport(0, 0, width, height); + constexpr ImVec4 clearColor{0.45f, 0.55f, 0.60f, 1.00f}; + glClearColor(clearColor.x * clearColor.w, clearColor.y * clearColor.w, clearColor.z * clearColor.w, clearColor.w); + glClear(GL_COLOR_BUFFER_BIT); + ImGui::Render(); ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData()); SDL_GL_SwapWindow(m_mainWindow.window()); -- cgit v1.2.3