glfw: fix and test VideoMode getters
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
5238e52d76
commit
72f09b4f32
2 changed files with 14 additions and 0 deletions
|
|
@ -5,6 +5,8 @@
|
|||
const std = @import("std");
|
||||
const c = @import("c.zig").c;
|
||||
|
||||
const VideoMode = @This();
|
||||
|
||||
handle: c.GLFWvidmode,
|
||||
|
||||
/// Returns the width of the video mode, in screen coordinates.
|
||||
|
|
@ -36,3 +38,13 @@ pub inline fn getBlueBits(self: VideoMode) usize {
|
|||
pub inline fn getRefreshRate(self: VideoMode) usize {
|
||||
return @intCast(usize, self.handle.refreshRate);
|
||||
}
|
||||
|
||||
test "getters" {
|
||||
const x = std.mem.zeroes(VideoMode);
|
||||
_ = x.getWidth();
|
||||
_ = x.getHeight();
|
||||
_ = x.getRedBits();
|
||||
_ = x.getGreenBits();
|
||||
_ = x.getBlueBits();
|
||||
_ = x.getRefreshRate();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue