Skip to content

Commit

Permalink
Fix debugdraw and BGFX_CONFIG_MULTITHREAD
Browse files Browse the repository at this point in the history
  • Loading branch information
OndraVoves committed Apr 17, 2024
1 parent eb71583 commit e41976f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ See examples for binding usage and [bgfx](https://github.com/bkaradzic/bgfx) for
| Build option | Default | Description |
|-----------------|---------|------------------------------------------------------|
| `imgui_include` | `null` | Path to ImGui includes (need for imgui bgfx backend) |
| `multithread` | `true` | Compile with BGFX_CONFIG_MULTITHREAD |
| `multithread` | `true` | Compile with `BGFX_CONFIG_MULTITHREADED` |
| `with_shaderc` | `true` | Compile with `shaderc` |

## Examples
Expand Down
6 changes: 2 additions & 4 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub fn build(b: *std.Build) !void {

const options = .{
.imgui_include = b.option([]const u8, "imgui_include", "Path to imgui (need for imgui bgfx backend)"),
.multithread = b.option(bool, "multithread", "Compile with BGFX_CONFIG_MULTITHREAD") orelse true,
.multithread = b.option(bool, "multithread", "Compile with BGFX_CONFIG_MULTITHREADED") orelse true,
.with_shaderc = b.option(bool, "with_shaderc", "Compile with shaderc executable") orelse true,
};

Expand Down Expand Up @@ -125,9 +125,7 @@ pub fn build(b: *std.Build) !void {
bgfx.linkLibrary(bx);
bgfx.linkLibrary(bimg);

if (options.multithread) {
bgfx.defineCMacro("BGFX_CONFIG_MULTITHREAD", "1");
}
bgfx.defineCMacro("BGFX_CONFIG_MULTITHREADED", if (options.multithread) "1" else "0");

bgfx.addIncludePath(.{ .path = "includes" });

Expand Down
2 changes: 1 addition & 1 deletion src/zbgfx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ extern "C"
}

///
void bgfx_EncoderSetWireframe(DebugDrawEncoder *dde, bool _wireframe)
void zbgfx_EncoderSetWireframe(DebugDrawEncoder *dde, bool _wireframe)
{
dde->setWireframe(_wireframe);
}
Expand Down

0 comments on commit e41976f

Please sign in to comment.