Skip to content

Commit 0d37714

Browse files
WIP: IMGUI
1 parent dc49a84 commit 0d37714

File tree

6 files changed

+315
-111
lines changed

6 files changed

+315
-111
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,7 @@ jobs:
6363
set VULKAN_SDK=D:/a/VulkanSDK
6464
cd src
6565
call build.bat
66-
if not exist ../out/pilotlight_python.exe exit 1
67-
if not exist ../out/glfwd.lib exit 1
68-
if not exist ../out/pl_platform_ext.lib exit 1
69-
if not exist ../out/python3_d.dll exit 1
70-
if not exist ../out/python314_d.dll exit 1
71-
if not exist ../pilotlight/pilotlight_d.pyd exit 1
66+
if %ERRORLEVEL% NEQ 0 exit 1
7267
7368
MacOS:
7469

@@ -110,50 +105,10 @@ jobs:
110105
111106
- name: Build Binaries
112107
run: |
113-
set -Eeuo pipefail
114-
115-
# Build
116-
pushd "$GITHUB_WORKSPACE/src" >/dev/null
108+
cd $GITHUB_WORKSPACE
109+
cd src
117110
chmod +x build.sh
118-
./build.sh
119-
popd >/dev/null
120-
121-
echo "=== Directory snapshots for debugging ==="
122-
echo "::group::ls -al ./out"
123-
ls -al ./out || true
124-
echo "::endgroup::"
125-
echo "::group::ls -al ./pilotlight"
126-
ls -al ./pilotlight || true
127-
echo "::endgroup::"
128-
129-
# List of required files relative to repo root
130-
required_files=(
131-
"./out/pilotlight_python"
132-
"./out/libglfwd.a"
133-
"./out/libpl_platform_ext.a"
134-
"./pilotlight/pilotlight.so"
135-
)
136-
137-
# Check for missing files and collect all failures before exiting
138-
missing=()
139-
for f in "${required_files[@]}"; do
140-
if [[ -f "$f" ]]; then
141-
echo "✅ Found: $f"
142-
else
143-
echo "::error file=$f::Missing required file"
144-
missing+=("$f")
145-
fi
146-
done
147-
148-
if ((${#missing[@]})); then
149-
echo ""
150-
echo "❌ Missing ${#missing[@]} required file(s):"
151-
printf ' - %s\n' "${missing[@]}"
152-
exit 1
153-
else
154-
echo "🎉 All required files are present."
155-
fi
156-
111+
./build.sh || exit 1
157112
158113
Ubuntu:
159114

@@ -208,46 +163,7 @@ jobs:
208163
209164
- name: Build Binaries
210165
run: |
211-
set -Eeuo pipefail
212-
213-
# Build
214-
pushd "$GITHUB_WORKSPACE/src" >/dev/null
166+
cd $GITHUB_WORKSPACE
167+
cd src
215168
chmod +x build.sh
216-
./build.sh
217-
popd >/dev/null
218-
219-
echo "=== Directory snapshots for debugging ==="
220-
echo "::group::ls -al ./out"
221-
ls -al ./out || true
222-
echo "::endgroup::"
223-
echo "::group::ls -al ./pilotlight"
224-
ls -al ./pilotlight || true
225-
echo "::endgroup::"
226-
227-
# List of required files relative to repo root
228-
required_files=(
229-
"./out/pilotlight_python"
230-
"./out/glfwd.a"
231-
"./out/pl_platform_ext.a"
232-
"./pilotlight/pilotlight.so"
233-
)
234-
235-
# Check for missing files and collect all failures before exiting
236-
missing=()
237-
for f in "${required_files[@]}"; do
238-
if [[ -f "$f" ]]; then
239-
echo "✅ Found: $f"
240-
else
241-
echo "::error file=$f::Missing required file"
242-
missing+=("$f")
243-
fi
244-
done
245-
246-
if ((${#missing[@]})); then
247-
echo ""
248-
echo "❌ Missing ${#missing[@]} required file(s):"
249-
printf ' - %s\n' "${missing[@]}"
250-
exit 1
251-
else
252-
echo "🎉 All required files are present."
253-
fi
169+
./build.sh || exit 1

pilotlight/pl_dearimgui_ext.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from typing import List, Any, Callable, Union, Tuple
2+
import pilotlight.imgui as imgui
3+
4+
5+
class plDearImGuiI:
6+
7+
def initialize(device, swapchain, renderpass_handle, **kwargs) -> None:
8+
return imgui.plImgui_initialize(device, swapchain, renderpass_handle, **kwargs)
9+
10+
def new_frame(device, renderpass_handle, **kwargs) -> None:
11+
return imgui.plImgui_new_frame(device, renderpass_handle, **kwargs)
12+
13+
def render(encoder, **kwargs) -> None:
14+
return imgui.plImgui_render(encoder, **kwargs)

sandbox/app.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from pilotlight.pl_vfs_ext import *
1414
from pilotlight.pl_shader_ext import *
1515
from pilotlight.pl_pak_ext import *
16+
from pilotlight.pl_dearimgui_ext import *
1617
import os
1718

1819
class App:
@@ -42,7 +43,7 @@ def pl_app_load(self):
4243

4344
plStarterI.finalize()
4445

45-
imgui.plImgui_initialize(plStarterI.get_device(), plStarterI.get_swapchain(), plStarterI.get_render_pass())
46+
plDearImGuiI.initialize(plStarterI.get_device(), plStarterI.get_swapchain(), plStarterI.get_render_pass())
4647

4748
# mod = plShaderI.load_glsl("draw_3d.frag", "main")
4849
# plShaderI.write_to_disk("C:/dev/pilotlight-python/sandbox/blah.spv", mod)
@@ -66,7 +67,7 @@ def pl_app_update(self):
6667
if not plStarterI.begin_frame():
6768
return
6869

69-
imgui.plImgui_new_frame(plStarterI.get_device(), plStarterI.get_render_pass())
70+
plDearImGuiI.new_frame(plStarterI.get_device(), plStarterI.get_render_pass())
7071
imgui.plImgui_test()
7172

7273
# drawing API
@@ -88,7 +89,7 @@ def pl_app_update(self):
8889

8990
render_encoder = plStarterI.begin_main_pass()
9091

91-
imgui.plImgui_render(render_encoder)
92+
plDearImGuiI.render(render_encoder)
9293

9394
plStarterI.end_main_pass()
9495

0 commit comments

Comments
 (0)