diff --git a/glfw/src/main.zig b/glfw/src/main.zig index 4e0c3cae..7c11a869 100644 --- a/glfw/src/main.zig +++ b/glfw/src/main.zig @@ -3,6 +3,21 @@ const testing = std.testing; const c = @cImport(@cInclude("GLFW/glfw3.h")); +// The major version number of the GLFW library. +// +// This is incremented when the API is changed in non-compatible ways. +pub const version_major = c.GLFW_VERSION_MAJOR; + +// The minor version number of the GLFW library. +// +// This is incremented when features are added to the API but it remains backward-compatible. +pub const version_minor = c.GLFW_VERSION_MINOR; + +// The revision number of the GLFW library. +// +// This is incremented when a bug fix release is made that does not contain any API changes. +pub const version_revision = c.GLFW_VERSION_REVISION; + pub fn basicTest() void { if (c.glfwInit() != c.GLFW_TRUE) { @panic("failed to init"); @@ -23,6 +38,10 @@ pub fn basicTest() void { c.glfwTerminate(); } +test "version" { + std.debug.print("\nGLFW version v{}.{}.{}\n", .{version_major, version_minor, version_revision}); +} + test "basic" { basicTest(); }