Skip to content

Commit fc563bc

Browse files
nspitkonotGlassySundew
authored andcommitted
Add support for SDL_GetGlobalMouseState (HaxeFoundation#672)
1 parent 4afc5cd commit fc563bc

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

libs/sdl/sdl.c

+5
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,10 @@ HL_PRIM bool HL_NAME(get_window_grab)(SDL_Window* window) {
475475
return SDL_GetWindowGrab(window);
476476
}
477477

478+
HL_PRIM int HL_NAME(get_global_mouse_state)(int* x, int* y) {
479+
return SDL_GetGlobalMouseState(x, y);
480+
}
481+
478482
HL_PRIM const char *HL_NAME(detect_keyboard_layout)() {
479483
char q = SDL_GetKeyFromScancode(SDL_SCANCODE_Q);
480484
char w = SDL_GetKeyFromScancode(SDL_SCANCODE_W);
@@ -509,6 +513,7 @@ DEFINE_PRIM(_I32, warp_mouse_global, _I32 _I32);
509513
DEFINE_PRIM(_VOID, warp_mouse_in_window, TWIN _I32 _I32);
510514
DEFINE_PRIM(_VOID, set_window_grab, TWIN _BOOL);
511515
DEFINE_PRIM(_BOOL, get_window_grab, TWIN);
516+
DEFINE_PRIM(_I32, get_global_mouse_state, _REF(_I32) _REF(_I32));
512517
DEFINE_PRIM(_BYTES, detect_keyboard_layout, _NO_ARG);
513518
DEFINE_PRIM(_BOOL, hint_value, _BYTES _BYTES);
514519

libs/sdl/sdl/Sdl.hx

+5
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,11 @@ class Sdl {
220220
return 0;
221221
}
222222

223+
@:hlNative("?sdl", "get_global_mouse_state")
224+
public static function getGlobalMouseState( x : hl.Ref<Int>, y : hl.Ref<Int> ) : Int {
225+
return 0;
226+
}
227+
223228
static function detect_keyboard_layout() : hl.Bytes {
224229
return null;
225230
}

0 commit comments

Comments
 (0)