Skip to content

Commit 6695807

Browse files
committed
WIP
1 parent e4fd95d commit 6695807

3 files changed

Lines changed: 3 additions & 12 deletions

File tree

extensions/pl_dearimgui_ext_m.cpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,7 @@ plImgui_initialize(PyObject* self, PyObject* args, PyObject* kwargs)
5555

5656
PyObject* ptCapsule = PyObject_GetAttrString(pymodule, "plApiRegistryICapsule");
5757
const plApiRegistryI* ptApiRegistry = (const plApiRegistryI*)PyCapsule_GetPointer(ptCapsule, "plApiRegistryI");
58-
gptDataRegistry = pl_get_api_latest(ptApiRegistry, plDataRegistryI);
59-
gptGfx = pl_get_api_latest(ptApiRegistry, plGraphicsI);
60-
61-
ImGuiContext* ptImguiContext = (ImGuiContext*)gptDataRegistry->get_data("imgui");
62-
ImGui::SetCurrentContext(ptImguiContext);
63-
64-
ImGuiMemAllocFunc p_alloc_func = (ImGuiMemAllocFunc)gptDataRegistry->get_data("imgui allocate");
65-
ImGuiMemFreeFunc p_free_func = (ImGuiMemFreeFunc)gptDataRegistry->get_data("imgui free");
66-
ImGui::SetAllocatorFunctions(p_alloc_func, p_free_func, nullptr);
58+
pl_load_dear_imgui_ext(ptApiRegistry, false);
6759

6860
PyObject* ptPythonDevice = nullptr;
6961
PyObject* ptPythonSwapchain = nullptr;

scripts/gen_build.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@
475475
pl.set_output_binary("imgui")
476476
pl.set_output_binary_extension(".so")
477477
pl.add_compiler_flags("-fPIC", "--debug -g", "-fmodules", "-ObjC++", "-arch arm64")
478-
pl.add_linker_flags("-ldl -lm")
478+
pl.add_linker_flags("-ldl -lm", "-undefined dynamic_lookup")
479479
pl.add_link_frameworks("Metal", "MetalKit", "Cocoa", "IOKit", "CoreVideo", "QuartzCore")
480480
pl.add_dynamic_link_libraries("shaderc_shared", "spirv-cross-c-shared")
481481
pl.add_static_link_libraries("glfwd", "pl_platform_ext")
@@ -528,7 +528,6 @@
528528
pl.add_definitions("PL_METAL_BACKEND")
529529
pl.add_include_directories("$PL_PYTHON_INCLUDES")
530530
pl.add_link_directories('$VULKAN_SD/Lib')
531-
pl.set_output_binary("pilotlight")
532531
pl.set_output_binary_extension(".so")
533532
pl.add_compiler_flags("-fPIC", "-fmodules", "-ObjC++", "-arch arm64")
534533
pl.add_linker_flags("-ldl -lm", "-undefined dynamic_lookup")

src/pl_main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Index of this file:
7171
#include "GLFW/glfw3native.h"
7272
#include "pl_internal.h"
7373

74-
#define Py_PYTHON_H
74+
#define PL_SINGLE_UNIT_BUILD
7575
#include "pl.c"
7676

7777
// extern plIO* gptIOCtx;

0 commit comments

Comments
 (0)