Skip to content

Commit

Permalink
Add window-focused? function
Browse files Browse the repository at this point in the history
  • Loading branch information
greenfork committed Oct 29, 2023
1 parent f62fb0d commit 80a2a12
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ static Janet cfun_IsWindowMinimized(int32_t argc, Janet *argv) {
return janet_wrap_boolean(IsWindowMinimized());
}

static Janet cfun_IsWindowFocused(int32_t argc, Janet *argv) {
(void) argv;
janet_fixarity(argc, 0);
return janet_wrap_boolean(IsWindowFocused());
}

static Janet cfun_IsWindowResized(int32_t argc, Janet *argv) {
(void) argv;
janet_fixarity(argc, 0);
Expand Down Expand Up @@ -930,6 +936,10 @@ static JanetReg core_cfuns[] = {
"(window-minimized?)\n\n"
"Check if window is currently minimized"
},
{"window-focused?", cfun_IsWindowFocused,
"(window-focused?)\n\n"
"Check if window is currently focused"
},
{"window-resized?", cfun_IsWindowResized,
"(window-resized?)\n\n"
"Check if window has been resized last frame"
Expand Down

0 comments on commit 80a2a12

Please sign in to comment.