glfw: add Window.defaultHints
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
477d8f85d8
commit
441d8d7928
2 changed files with 33 additions and 0 deletions
31
glfw/src/Window.zig
Normal file
31
glfw/src/Window.zig
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
//! Window type and related functions
|
||||
|
||||
const std = @import("std");
|
||||
const c = @import("c.zig").c;
|
||||
|
||||
const Error = @import("errors.zig").Error;
|
||||
const getError = @import("errors.zig").getError;
|
||||
|
||||
const Window = @This();
|
||||
|
||||
/// Resets all window hints to their default values.
|
||||
///
|
||||
/// This function resets all window hints to their default values.
|
||||
///
|
||||
/// Possible errors include glfw.Error.NotInitialized.
|
||||
///
|
||||
/// @thread_safety This function must only be called from the main thread.
|
||||
///
|
||||
/// see also: window_hints, glfw.Window.hint, glfw.Window.hintString
|
||||
pub fn defaultHints() Error!void {
|
||||
c.glfwDefaultWindowHints();
|
||||
try getError();
|
||||
}
|
||||
|
||||
test "defaultHints" {
|
||||
const glfw = @import("main.zig");
|
||||
try glfw.init();
|
||||
defer glfw.terminate();
|
||||
|
||||
try defaultHints();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue