opengl: support extension iteration, list in debug mode

This commit is contained in:
Mitchell Hashimoto
2022-08-04 11:13:56 -07:00
parent e163e4962b
commit bb0b95732e
3 changed files with 39 additions and 0 deletions

View File

@@ -124,6 +124,7 @@ const Cursor = struct {
);
}
/// Stop the timer. This is idempotent.
pub fn stopTimer(self: Cursor) !void {
try self.timer.stop();
}
@@ -166,6 +167,12 @@ pub fn create(alloc: Allocator, loop: libuv.Loop, config: *const Config) !*Windo
gl.glad.versionMajor(version),
gl.glad.versionMinor(version),
});
if (builtin.mode == .Debug) {
var ext_iter = try gl.ext.iterator();
while (try ext_iter.next()) |ext| {
log.debug("OpenGL extension available name={s}", .{ext});
}
}
// Culling, probably not necessary. We have to change the winding
// order since our 0,0 is top-left.