Skip to content

Commit

Permalink
Fix customizable gl namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
Sirius902 authored and ikskuh committed Jul 24, 2022
1 parent 64e70cf commit 738622e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
8 changes: 8 additions & 0 deletions c.zig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const root = @import("root");

pub usingnamespace if (@hasDecl(root, "gl"))
root.gl
else
@cImport({
@cInclude("epoxy/gl.h");
});
4 changes: 1 addition & 3 deletions types.zig
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
const c = @cImport({
@cInclude("epoxy/gl.h");
});
const c = @import("c.zig");

const gl = @import("zgl.zig");

Expand Down
10 changes: 2 additions & 8 deletions zgl.zig
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
const std = @import("std");
const root = @import("root");

const c = if (@hasDecl(root, "gl"))
root.gl
else
@cImport({
@cInclude("epoxy/gl.h");
});

const c = @import("c.zig");

comptime {
std.testing.refAllDecls(@This());
Expand Down

0 comments on commit 738622e

Please sign in to comment.