-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal: Make zgui a module for emscripten #22
base: main
Are you sure you want to change the base?
Conversation
@@ -1678,7 +1678,7 @@ const ImageButton = struct { | |||
pub fn imageButton(str_id: [:0]const u8, user_texture_id: TextureIdent, args: ImageButton) bool { | |||
return zguiImageButton( | |||
str_id, | |||
user_texture_id, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this meant to be here?
@@ -1689,7 +1689,7 @@ pub fn imageButton(str_id: [:0]const u8, user_texture_id: TextureIdent, args: Im | |||
} | |||
extern fn zguiImageButton( | |||
str_id: [*:0]const u8, | |||
user_texture_id: TextureIdent, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this?
// imgui.addCMacro("IMGUI_API", "__declspec(dllexport)"); | ||
// imgui.addCMacro("IMPLOT_API", "__declspec(dllexport)"); | ||
// imgui.addCMacro("ZGUI_API", "__declspec(dllexport)"); | ||
//} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to self: Maybe this should go in the readme.
In order to build for emscripten, all library code must be imported into the wasm lib instead of linked. Zig modules seem to cover both emscripten and native builds. Also a fix in the underlying imgui lib can be removed and an additional C flag can be added to build for native wgpu.
Might be stomping on some toes by removing the shared / static library, maybe we should have a linked build and a module build side by side?
Tested against gui_test_wgpu for native and my project for native and web.