Skip to content

Commit c3d4236

Browse files
authored
Merge pull request zig-gamedev#248 from hazeycode/main
zopengl: a bit more wrapper coverage
2 parents e0ceda4 + 6b4a7f2 commit c3d4236

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

libs/zopengl/src/wrapper.zig

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,17 @@ pub const ParameterName = enum(Enum) {
308308
timestamp = TIMESTAMP,
309309
};
310310

311+
pub const DepthFunc = enum(Enum) {
312+
never = NEVER,
313+
less = LESS,
314+
equal = EQUAL,
315+
lequal = LEQUAL,
316+
greater = GREATER,
317+
notequal = NOTEQUAL,
318+
gequal = GEQUAL,
319+
always = ALWAYS,
320+
};
321+
311322
pub const ShaderType = enum(Enum) {
312323
//----------------------------------------------------------------------------------------------
313324
// OpenGL 2.0 (Core Profile)
@@ -962,7 +973,12 @@ pub fn enable(capability: Capability) void {
962973
// pub var logicOp: *const fn (opcode: Enum) callconv(.C) void = undefined;
963974
// pub var stencilFunc: *const fn (func: Enum, ref: Int, mask: Uint) callconv(.C) void = undefined;
964975
// pub var stencilOp: *const fn (fail: Enum, zfail: Enum, zpass: Enum) callconv(.C) void = undefined;
976+
965977
// pub var depthFunc: *const fn (func: Enum) callconv(.C) void = undefined;
978+
pub fn depthFunc(func: DepthFunc) void {
979+
bindings.depthFunc(@enumToInt(func));
980+
}
981+
966982
// pub var pixelStoref: *const fn (pname: Enum, param: Float) callconv(.C) void = undefined;
967983
// pub var pixelStorei: *const fn (pname: Enum, param: Int) callconv(.C) void = undefined;
968984
// pub var readBuffer: *const fn (src: Enum) callconv(.C) void = undefined;
@@ -1026,7 +1042,11 @@ pub fn getString(name: StringName) [*:0]const u8 {
10261042
// ) callconv(.C) void = undefined;
10271043
// pub var isEnabled: *const fn (cap: Enum) callconv(.C) Boolean = undefined;
10281044
// pub var depthRange: *const fn (n: Double, f: Double) callconv(.C) void = undefined;
1045+
10291046
// pub var viewport: *const fn (x: Int, y: Int, width: Sizei, height: Sizei) callconv(.C) void = undefined;
1047+
pub fn viewport(x: Int, y: Int, width: u32, height: u32) void {
1048+
bindings.viewport(x, y, @bitCast(Sizei, width), @bitCast(Sizei, height));
1049+
}
10301050

10311051
//--------------------------------------------------------------------------------------------------
10321052
//

0 commit comments

Comments
 (0)