Skip to content

Commit 1b83482

Browse files
authored
Integrated IsWindowHovered (#61)
Added support for IsWindowHovered
1 parent 80e94d7 commit 1b83482

File tree

4 files changed

+46
-0
lines changed

4 files changed

+46
-0
lines changed

api.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,22 @@
702702
"summary": "IsWindowFocused",
703703
"usage": null
704704
},
705+
{
706+
"description": "",
707+
"has_params": false,
708+
"has_returns": true,
709+
"name": "is_window_hovered",
710+
"params": [],
711+
"returns": [
712+
{
713+
"description": "",
714+
"name": "result",
715+
"type": "bool"
716+
}
717+
],
718+
"summary": "IsWindowHovered",
719+
"usage": null
720+
},
705721
{
706722
"description": "",
707723
"has_params": false,

api.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,14 @@ RETURNS
284284
* `focused` [`boolean`] -
285285

286286

287+
### is_window_hovered()
288+
IsWindowHovered
289+
290+
291+
RETURNS
292+
* `result` [`bool`] -
293+
294+
287295
### get_content_region_avail()
288296
GetContentRegionAvail
289297

imgui/api/imgui.script_api

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,14 @@
364364
type: boolean
365365

366366

367+
- name: is_window_hovered
368+
type: function
369+
desc: IsWindowHovered
370+
returns:
371+
- name: result
372+
type: bool
373+
374+
367375
- name: get_content_region_avail
368376
type: function
369377
desc: GetContentRegionAvail

imgui/src/extension_imgui.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -788,6 +788,19 @@ static int imgui_IsWindowFocused(lua_State* L)
788788
return 1;
789789
}
790790

791+
/** IsWindowHovered
792+
* @name is_window_hovered
793+
* @treturn bool result
794+
*/
795+
static int imgui_IsWindowHovered(lua_State* L)
796+
{
797+
DM_LUA_STACK_CHECK(L, 1);
798+
imgui_NewFrame();
799+
bool hovered = ImGui::IsWindowHovered();
800+
lua_pushboolean(L, hovered);
801+
return 1;
802+
}
803+
791804
/** GetContentRegionAvail
792805
* @name get_content_region_avail
793806
* @treturn number x
@@ -3158,6 +3171,7 @@ static const luaL_reg Module_methods[] =
31583171
{"begin_window", imgui_Begin},
31593172
{"end_window", imgui_End},
31603173
{"is_window_focused", imgui_IsWindowFocused},
3174+
{"is_window_hovered", imgui_IsWindowHovered},
31613175
{"get_content_region_avail", imgui_GetContentRegionAvail},
31623176
{"get_window_content_region_max", imgui_GetWindowContentRegionMax},
31633177

0 commit comments

Comments
 (0)