Browse Source

Added imgui theme, fix tracy space and include

windows-imgui
Macoy Madson 9 months ago
parent
commit
f14efacfe4
  1. 67
      src/ImGui.cake
  2. 4
      src/Tracy.cake

67
src/ImGui.cake

@ -19,6 +19,65 @@
(call (in ImGui (token-splice function)))))
(return true))
(defun imgui-set-style-red-dark ()
;; copied and modified from https://github.com/ocornut/imgui/issues/707
(var colors (* ImVec4) (field (imgui-call GetStyle) Colors))
(set (at ImGuiCol_Text colors) (ImVec4 0.75f 0.75f 0.75f 1.00f))
(set (at ImGuiCol_TextDisabled colors) (ImVec4 0.35f 0.35f 0.35f 1.00f))
(set (at ImGuiCol_WindowBg colors) (ImVec4 0.00f 0.00f 0.00f 0.94f))
(set (at ImGuiCol_ChildBg colors) (ImVec4 0.00f 0.00f 0.00f 0.00f))
(set (at ImGuiCol_PopupBg colors) (ImVec4 0.08f 0.08f 0.08f 0.94f))
(set (at ImGuiCol_Border colors) (ImVec4 0.00f 0.00f 0.00f 0.50f))
(set (at ImGuiCol_BorderShadow colors) (ImVec4 0.00f 0.00f 0.00f 0.00f))
(set (at ImGuiCol_FrameBg colors) (ImVec4 0.25f 0.25f 0.25f 0.54f))
(set (at ImGuiCol_FrameBgHovered colors) (ImVec4 0.37f 0.14f 0.14f 0.67f))
(set (at ImGuiCol_FrameBgActive colors) (ImVec4 0.39f 0.20f 0.20f 0.67f))
(set (at ImGuiCol_TitleBg colors) (ImVec4 0.04f 0.04f 0.04f 1.00f))
(set (at ImGuiCol_TitleBgActive colors) (ImVec4 0.48f 0.16f 0.16f 1.00f))
(set (at ImGuiCol_TitleBgCollapsed colors) (ImVec4 0.48f 0.16f 0.16f 1.00f))
(set (at ImGuiCol_MenuBarBg colors) (ImVec4 0.14f 0.14f 0.14f 1.00f))
(set (at ImGuiCol_ScrollbarBg colors) (ImVec4 0.02f 0.02f 0.02f 0.53f))
(set (at ImGuiCol_ScrollbarGrab colors) (ImVec4 0.31f 0.31f 0.31f 1.00f))
(set (at ImGuiCol_ScrollbarGrabHovered colors) (ImVec4 0.41f 0.41f 0.41f 1.00f))
(set (at ImGuiCol_ScrollbarGrabActive colors) (ImVec4 0.51f 0.51f 0.51f 1.00f))
(set (at ImGuiCol_CheckMark colors) (ImVec4 0.56f 0.10f 0.10f 1.00f))
(set (at ImGuiCol_SliderGrab colors) (ImVec4 1.00f 0.19f 0.19f 0.40f))
(set (at ImGuiCol_SliderGrabActive colors) (ImVec4 0.89f 0.00f 0.19f 1.00f))
(set (at ImGuiCol_Button colors) (ImVec4 1.00f 0.19f 0.19f 0.40f))
(set (at ImGuiCol_ButtonHovered colors) (ImVec4 0.80f 0.17f 0.00f 1.00f))
(set (at ImGuiCol_ButtonActive colors) (ImVec4 0.89f 0.00f 0.19f 1.00f))
(set (at ImGuiCol_Header colors) (ImVec4 0.33f 0.35f 0.36f 0.53f))
(set (at ImGuiCol_HeaderHovered colors) (ImVec4 0.76f 0.28f 0.44f 0.67f))
(set (at ImGuiCol_HeaderActive colors) (ImVec4 0.47f 0.47f 0.47f 0.67f))
(set (at ImGuiCol_Separator colors) (ImVec4 0.32f 0.32f 0.32f 1.00f))
(set (at ImGuiCol_SeparatorHovered colors) (ImVec4 0.32f 0.32f 0.32f 1.00f))
(set (at ImGuiCol_SeparatorActive colors) (ImVec4 0.32f 0.32f 0.32f 1.00f))
(set (at ImGuiCol_ResizeGrip colors) (ImVec4 1.00f 1.00f 1.00f 0.85f))
(set (at ImGuiCol_ResizeGripHovered colors) (ImVec4 1.00f 1.00f 1.00f 0.60f))
(set (at ImGuiCol_ResizeGripActive colors) (ImVec4 1.00f 1.00f 1.00f 0.90f))
(set (at ImGuiCol_Tab colors) (ImVec4 0.07f 0.07f 0.07f 0.51f))
(set (at ImGuiCol_TabHovered colors) (ImVec4 0.86f 0.23f 0.43f 0.67f))
(set (at ImGuiCol_TabActive colors) (ImVec4 0.19f 0.19f 0.19f 0.57f))
(set (at ImGuiCol_TabUnfocused colors) (ImVec4 0.05f 0.05f 0.05f 0.90f))
(set (at ImGuiCol_TabUnfocusedActive colors) (ImVec4 0.13f 0.13f 0.13f 0.74f))
;; (set (at ImGuiCol_DockingPreview colors) (ImVec4 0.47f 0.47f 0.47f 0.47f))
;; (set (at ImGuiCol_DockingEmptyBg colors) (ImVec4 0.20f 0.20f 0.20f 1.00f))
(set (at ImGuiCol_PlotLines colors) (ImVec4 0.61f 0.61f 0.61f 1.00f))
(set (at ImGuiCol_PlotLinesHovered colors) (ImVec4 1.00f 0.43f 0.35f 1.00f))
(set (at ImGuiCol_PlotHistogram colors) (ImVec4 0.90f 0.70f 0.00f 1.00f))
(set (at ImGuiCol_PlotHistogramHovered colors) (ImVec4 1.00f 0.60f 0.00f 1.00f))
(set (at ImGuiCol_TableHeaderBg colors) (ImVec4 0.19f 0.19f 0.20f 1.00f))
(set (at ImGuiCol_TableBorderStrong colors) (ImVec4 0.31f 0.31f 0.35f 1.00f))
(set (at ImGuiCol_TableBorderLight colors) (ImVec4 0.23f 0.23f 0.25f 1.00f))
(set (at ImGuiCol_TableRowBg colors) (ImVec4 0.00f 0.00f 0.00f 0.00f))
(set (at ImGuiCol_TableRowBgAlt colors) (ImVec4 1.00f 1.00f 1.00f 0.07f))
(set (at ImGuiCol_TextSelectedBg colors) (ImVec4 0.26f 0.59f 0.98f 0.35f))
(set (at ImGuiCol_DragDropTarget colors) (ImVec4 1.00f 1.00f 0.00f 0.90f))
(set (at ImGuiCol_NavHighlight colors) (ImVec4 0.26f 0.59f 0.98f 1.00f))
(set (at ImGuiCol_NavWindowingHighlight colors) (ImVec4 1.00f 1.00f 1.00f 0.70f))
(set (at ImGuiCol_NavWindowingDimBg colors) (ImVec4 0.80f 0.80f 0.80f 0.20f))
(set (at ImGuiCol_ModalWindowDimBg colors) (ImVec4 0.80f 0.80f 0.80f 0.35f)))
(comptime-cond
('auto-test
(import "SDL.cake")
@ -57,7 +116,10 @@
(imgui-call CreateContext)
(imgui-call StyleColorsDark)
(scope ;; Enable keyboard navigation
(var imgui-io (& ImGuiIO) (imgui-call GetIO))
(set (field imgui-io ConfigFlags) (bit-or (field imgui-io ConfigFlags)
ImGuiConfigFlags_NavEnableKeyboard)))
(var g-dpi-scale float 1.7f)
(scope ;; DPI scaling
@ -75,6 +137,9 @@
;; imgui-io.Fonts->GetTexDataAsRGBA32();
(call-on-ptr Build (field imgui-io Fonts)))
;; (imgui-call StyleColorsDark)
(imgui-set-style-red-dark)
;; Note: Passing in null for the context will break Viewports branch of ImGui
(unless (ImGui_ImplSDL2_InitForOpenGL window gl-context)
(printf "Failed ImGui_ImplSDL2_InitForOpenGL\n")

4
src/Tracy.cake

@ -1,7 +1,7 @@
(set-cakelisp-option cakelisp-src-dir "Dependencies/cakelisp/src")
(add-cakelisp-search-directory "Dependencies/cakelisp/runtime")
(import &comptime-only "ComptimeHelpers.cake" "Dependencies.cake")
(import &comptime-only "ComptimeHelpers.cake" "Dependencies.cake" "BuildTools.cake")
(c-import &with-decls "Tracy.hpp" "TracyC.h")
@ -56,7 +56,7 @@
(when (fileExists "Dependencies/tracy/profiler/build/unix/Tracy-release")
(return true))))
(Log "error: did not build Tracy profiler. Is this platform unsupported? Was Tracy built in an
unexpected location?")
unexpected location?")
(return false))
(add-dependency-git-submodule clone-tracy "https://github.com/wolfpld/tracy" "Dependencies/tracy")

Loading…
Cancel
Save