git.s-ol.nu zig-imgui / master src / debug_gl.zig
master

Tree @master (Download .tar.gz)

debug_gl.zig @masterraw · history · blame

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 == .ReleaseFast) c.GL_FALSE else c.GL_TRUE;

pub fn assertNoError() void {
    if (builtin.mode != .ReleaseFast) {
        const err = c.glGetError();
        if (err != c.GL_NO_ERROR) {
            panic("GL error: {}\n", err);
        }
    }
}