glfw: add system for nice Zig callbacks, add Window.setPosCallback
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
a93de211cf
commit
09415dd3e8
2 changed files with 98 additions and 41 deletions
|
|
@ -48,7 +48,7 @@ pub inline fn makeContextCurrent(window: ?Window) Error!void {
|
|||
pub inline fn getCurrentContext() Error!?Window {
|
||||
const handle = c.glfwGetCurrentContext();
|
||||
try getError();
|
||||
if (handle) |h| return Window{ .handle = h };
|
||||
if (handle) |h| return try Window.from(h);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue