diff options
| author | s-ol <s-ol@users.noreply.github.com> | 2019-10-21 11:25:07 +0000 |
|---|---|---|
| committer | s-ol <s-ol@users.noreply.github.com> | 2019-10-21 11:25:07 +0000 |
| commit | 7a229736d61ceda807a02a264df57e86a3ebb25c (patch) | |
| tree | b152a6a6f132cb807abc006759e4b66d493db894 /src/debug_gl.zig | |
| parent | more glfw (diff) | |
| download | zig-imgui-7a229736d61ceda807a02a264df57e86a3ebb25c.tar.gz zig-imgui-7a229736d61ceda807a02a264df57e86a3ebb25c.zip | |
first working render!
Diffstat (limited to 'src/debug_gl.zig')
| -rw-r--r-- | src/debug_gl.zig | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/debug_gl.zig b/src/debug_gl.zig new file mode 100644 index 0000000..debf51d --- /dev/null +++ b/src/debug_gl.zig @@ -0,0 +1,16 @@ +const c = @import("c.zig"); +const std = @import("std"); +const os = std.os; +const panic = std.debug.panic; +const builtin = @import("builtin"); + +pub const is_on = if (builtin.mode == builtin.Mode.ReleaseFast) c.GL_FALSE else c.GL_TRUE; + +pub fn assertNoError() void { + if (builtin.mode != builtin.Mode.ReleaseFast) { + const err = c.glGetError(); + if (err != c.GL_NO_ERROR) { + panic("GL error: {}\n", err); + } + } +} |
