Compare commits

..

12 Commits

Author SHA1 Message Date
Rekai Nyangadzayi Musuka 2e4f8d1409 chore: Update to Zig v0.11.0 2023-08-06 22:38:29 +01:00
Rekai Nyangadzayi Musuka 1fa5c9675f fix: ensure that main.zig is removed 2023-08-06 21:47:36 +01:00
Rekai Nyangadzayi Musuka b43bf52174 fix: restore import for glfw w/ opengl3 backend
rebase unalived that specific line. Whoops
2023-08-06 21:47:36 +01:00
Rekai Nyangadzayi Musuka ecc96a9c82 feat: prefer SDL.h instead of SDL/SDL.h on all supported platforms 2023-08-06 21:47:36 +01:00
Rekai Nyangadzayi Musuka e895db97bc chore: explicitly link SDL2
TODO: What happens on Windows? macOS?
2023-08-06 21:47:36 +01:00
Rekai Nyangadzayi Musuka d32da2737b fix: vcpkg stores SDL.h under SDL2 folder
macOS and Linux seem to not, so in order to get CI working again I
should make use of the preprocessor.

FIXME: I think this makes vcpkg a **hard** requirement which perhaps
isn't ideal if I want ZBA to be as easy to build as possible. I should
try ensuring that building w/out vcpkg works as well
2023-08-06 21:47:36 +01:00
Rekai Nyangadzayi Musuka e4ff7b26ec feat: add sdl2-opengl3 backend impl 2023-08-06 21:47:36 +01:00
Rekai Nyangadzayi Musuka 4dd693ed59 chore: handle all cases of enum 2023-08-06 21:47:36 +01:00
Rekai Nyangadzayi Musuka 5b2b5e31db chore: combine render() and draw() in backend 2023-08-06 21:47:36 +01:00
Rekai Nyangadzayi Musuka 35b5d28ee8 feat: add backend impl for glfw+opengl3 2023-08-06 21:47:36 +01:00
Rekai Nyangadzayi Musuka 8f739d3594 feat: add glfw+opengl3 backend option to build.zig 2023-08-06 21:47:36 +01:00
Rekai Nyangadzayi Musuka 918168216a chore: add necessary imgui files for opengl3 2023-08-06 21:47:36 +01:00
3 changed files with 4 additions and 6 deletions

View File

@ -1,6 +1,6 @@
# zgui v1.89.6 - dear imgui bindings
Easy to use, hand-crafted API with default arguments, named parameters and Zig style text formatting. [Here](https://github.com/michal-z/zig-gamedev/tree/main/samples/minimal_zgpu_zgui) is a simple sample application, and [here](https://github.com/michal-z/zig-gamedev/tree/main/samples/gui_test_wgpu) is a full one.
Easy to use, hand-crafted API with default arguments, named parameters and Zig style text formatting. For a test application please see [here](https://github.com/michal-z/zig-gamedev/tree/main/samples/gui_test_wgpu).
## Features
@ -13,7 +13,7 @@ Easy to use, hand-crafted API with default arguments, named parameters and Zig s
Copy `zgui` folder to a `libs` subdirectory of the root of your project.
To get glfw/wgpu rendering backend working also copy `zgpu`, `zglfw`, `zpool` and `system-sdk` folders (see [zgpu](https://github.com/michal-z/zig-gamedev/tree/main/libs/zgpu) for the details). Alternatively, you can provide your own rendering backend, see: [backend_glfw_wgpu.zig](src/backend_glfw_wgpu.zig) for an example.
To get glfw/wgpu rendering backend working also copy `zgpu`, `zglfw` and `zpool` folders (see [zgpu](https://github.com/michal-z/zig-gamedev/tree/main/libs/zgpu) for the details). Alternatively, you can provide your own rendering backend, see: [backend_glfw_wgpu.zig](src/backend_glfw_wgpu.zig) for an example.
Then in your `build.zig` add:
```zig

View File

@ -74,9 +74,7 @@ pub fn package(
zgui_c_cpp.addIncludePath(.{ .path = thisDir() ++ "/libs" });
zgui_c_cpp.addIncludePath(.{ .path = thisDir() ++ "/libs/imgui" });
const abi = (std.zig.system.NativeTargetInfo.detect(target) catch unreachable).target.abi;
zgui_c_cpp.linkLibC();
if (abi != .msvc)
zgui_c_cpp.linkLibCpp();
const cflags = &.{"-fno-sanitize=undefined"};

View File

@ -2705,7 +2705,7 @@ extern fn zguiSetNextItemOpen(is_open: bool, cond: Condition) void;
//--------------------------------------------------------------------------------------------------
pub const SelectableFlags = packed struct(u32) {
dont_close_popups: bool = false,
span_all_columns: bool = false,
span_all_colums: bool = false,
allow_double_click: bool = false,
disabled: bool = false,
allow_item_overlap: bool = false,