Browse Source

Fix ImGui and TaskSystem exports

master
Macoy Madson 1 month ago
parent
commit
12652b79c7
  1. 20
      src/ImGui.cake
  2. 16
      src/TaskSystem.cake

20
src/ImGui.cake

@ -216,11 +216,19 @@
"Dependencies/imgui"
"docking")
;; TODO This is a hack: add build output dir as search directory. Should be built in?
(defun-comptime add-search-build-directory (manager (& ModuleManager) module (* Module)
&return bool)
(call-on push_back (path module > cSearchDirectories)
(call-on c_str (field manager buildOutputDir)))
(return true))
(export-and-evaluate
;; Different loaders are available. Loader selection could be done via macro to allow that flexibility
(import "OpenGL.cake")
(import "SDL.cake")
(c-import "SDL.h"
"imgui.h"
"imgui_impl_sdl.h" ;; Platform (inputs etc.)
"imgui_impl_opengl3.h") ;; Rendering
;; From ImGuiSDLOpenGL.cpp
@ -228,19 +236,12 @@
(declare-extern-function ImGuiSDLOpenGL_InitializeGLLoader (&return bool))
(declare-extern-function ImGuiSDLOpenGL_ClearWindow (io (* ImGuiIO) clear-color ImVec4))
;; TODO This is a hack: add build output dir as search directory. Should be built in?
(defun-comptime add-search-build-directory (manager (& ModuleManager) module (* Module)
&return bool)
(call-on push_back (path module > cSearchDirectories)
(call-on c_str (field manager buildOutputDir)))
(return true))
(add-compile-time-hook-module pre-build add-search-build-directory)
(add-c-search-directory-module
"Dependencies/gamelib/src"
"Dependencies/imgui"
"Dependencies/imgui/backends")
(add-cpp-build-dependency "imgui_impl_sdl.cpp" "ImGuiSDLOpenGL.cpp" "imgui_impl_opengl3.cpp")
(add-compile-time-hook-module pre-build add-search-build-directory)
(comptime-cond
('Unix
@ -253,6 +254,7 @@
"imgui_draw.cpp"
"imgui_tables.cpp"
"imgui_widgets.cpp")
(add-cpp-build-dependency "imgui_impl_sdl.cpp" "ImGuiSDLOpenGL.cpp" "imgui_impl_opengl3.cpp")
;;
;; Testing

16
src/TaskSystem.cake

@ -1,8 +1,19 @@
;; TaskSystem.cake: Interface into task-based multithreading
(import &comptime-only "ComptimeHelpers.cake" "CHelpers.cake")
(c-import "stdlib.h" ;; malloc, free
"string.h" ;; memset
&with-decls "TaskScheduler_c.h") ;; TODO: Infect modules rather than needing with-decls
"string.h") ;; memset
(export-and-evaluate
(add-c-search-directory-module "Dependencies/enkiTS/src")
(c-import "TaskScheduler_c.h"))
(forward-declare
(struct enkiCompletionAction)
(struct enkiTaskSet)
(struct enkiPinnedTask)
(struct enkiCompletable)
(struct enkiDependency)
(struct enkiTaskScheduler))
(def-function-signature-global task-system-task-signature (task-range-start (unsigned int)
task-range-end (unsigned int)
@ -740,7 +751,6 @@
(add-dependency-git-submodule clone-enkiTS
"https://github.com/dougbinks/enkiTS"
"Dependencies/enkiTS")
(add-c-search-directory-module "Dependencies/enkiTS/src")
(add-cpp-build-dependency "TaskScheduler.cpp" "TaskScheduler_c.cpp")
(comptime-cond
('Unix

Loading…
Cancel
Save