Skip to content

Commit

Permalink
fix wgpu examples after move of files
Browse files Browse the repository at this point in the history
  • Loading branch information
laytan committed Sep 29, 2024
1 parent 534a968 commit 4969cad
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions wgpu/microui/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ INITIAL_MEMORY_BYTES := $(shell expr $(INITIAL_MEMORY_PAGES) \* $(PAGE_SIZE))
MAX_MEMORY_BYTES := $(shell expr $(MAX_MEMORY_PAGES) \* $(PAGE_SIZE))

WGPU_JS := $(shell odin root)/vendor/wgpu/wgpu.js
RUNTIME_JS := $(shell odin root)/vendor/wasm/js/runtime.js
ODIN_JS := $(shell odin root)/core/sys/wasm/js/odin.js

web/microui.wasm: $(FILES) $(WGPU_JS) $(RUNTIME_JS)
odin build . \
-target:js_wasm32 -out:web/microui.wasm -o:size \
-extra-linker-flags:"--export-table --import-memory --initial-memory=$(INITIAL_MEMORY_BYTES) --max-memory=$(MAX_MEMORY_BYTES)"

cp $(WGPU_JS) web/wgpu.js
cp $(RUNTIME_JS) web/runtime.js
cp $(ODIN_JS) web/odin.js
2 changes: 1 addition & 1 deletion wgpu/microui/build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ call odin.exe build . -target:js_wasm32 -out:web/microui.wasm -o:size -extra-lin

for /f "delims=" %%i in ('odin.exe root') do set "ODIN_ROOT=%%i"
copy "%ODIN_ROOT%\vendor\wgpu\wgpu.js" "web\wgpu.js"
copy "%ODIN_ROOT%\vendor\wasm\js\runtime.js" "web\runtime.js"
copy "%ODIN_ROOT%\core\sys\wasm\js\odin.js" "web\odin.js"
2 changes: 1 addition & 1 deletion wgpu/microui/os_js.odin
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package vendor_wgpu_example_microui

import "core:sys/wasm/js"
import "core:unicode"
import "core:unicode/utf8"

import "vendor:wgpu"
import "vendor:wasm/js"
import mu "vendor:microui"

OS :: struct {
Expand Down
2 changes: 1 addition & 1 deletion wgpu/microui/web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<body id="body" style="height: 100%; padding: 0; margin: 0; overflow: hidden;">
<canvas id="wgpu-canvas" style="height: 100%; width: 100%;"></canvas>

<script type="text/javascript" src="runtime.js"></script>
<script type="text/javascript" src="odin.js"></script>
<script type="text/javascript" src="wgpu.js"></script>
<script type="text/javascript">
const mem = new WebAssembly.Memory({ initial: 2000, maximum: 65536, shared: false });
Expand Down

0 comments on commit 4969cad

Please sign in to comment.