Compare commits

..

2 Commits

Author SHA1 Message Date
Rekai Nyangadzayi Musuka ca27a47224 chore: add necessary imgui files for opengl3
feat: add glfw+opengl3 backend option to build.zig

feat: add backend impl for glfw+opengl3

chore: combine render() and draw() in backend

chore: handle all cases of enum

feat: add sdl2-opengl3 backend impl

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

chore: explicitly link SDL2

TODO: What happens on Windows? macOS?

feat: prefer SDL.h instead of SDL/SDL.h on all supported platforms

fix: restore import for glfw w/ opengl3 backend

rebase unalived that specific line. Whoops

fix: ensure that main.zig is removed

chore: Update to Zig v0.11.0
2023-10-07 02:59:02 -05:00
Rekai Nyangadzayi Musuka cb1cc16c8f chore: update to zgui 4f14a690fe8fbfce37a50dcf666e2293a19abbba 2023-10-07 02:53:20 -05:00
3 changed files with 6 additions and 4 deletions

View File

@ -1,6 +1,6 @@
# zgui v1.89.6 - dear imgui bindings # zgui v1.89.6 - dear imgui bindings
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). 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.
## Features ## 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. Copy `zgui` folder to a `libs` subdirectory of the root of your project.
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. 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.
Then in your `build.zig` add: Then in your `build.zig` add:
```zig ```zig

View File

@ -74,8 +74,10 @@ pub fn package(
zgui_c_cpp.addIncludePath(.{ .path = thisDir() ++ "/libs" }); zgui_c_cpp.addIncludePath(.{ .path = thisDir() ++ "/libs" });
zgui_c_cpp.addIncludePath(.{ .path = thisDir() ++ "/libs/imgui" }); zgui_c_cpp.addIncludePath(.{ .path = thisDir() ++ "/libs/imgui" });
const abi = (std.zig.system.NativeTargetInfo.detect(target) catch unreachable).target.abi;
zgui_c_cpp.linkLibC(); zgui_c_cpp.linkLibC();
zgui_c_cpp.linkLibCpp(); if (abi != .msvc)
zgui_c_cpp.linkLibCpp();
const cflags = &.{"-fno-sanitize=undefined"}; 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) { pub const SelectableFlags = packed struct(u32) {
dont_close_popups: bool = false, dont_close_popups: bool = false,
span_all_colums: bool = false, span_all_columns: bool = false,
allow_double_click: bool = false, allow_double_click: bool = false,
disabled: bool = false, disabled: bool = false,
allow_item_overlap: bool = false, allow_item_overlap: bool = false,