![]() |
LibGame
v0.4.0
The LG Game Engine - Copyright (C) 2024-2025 ETMSoftware
|
Functions | |
| zboolean | lg_mouse_get_state (SDL_Event event, zboolean *left_click, zboolean *right_click, int *x, int *y, int *dx, int *dy, int *dz_wheel) |
| int | lg_mouse_override_delta_threshold (int new_threshold) |
| void | lg_flush_mouse_events () |
| void | lg_wait_for_any_key_pressed_or_left_click () |
=== Mouse-related stuff ===
| zboolean lg_mouse_get_state | ( | SDL_Event | event, |
| zboolean * | left_click, | ||
| zboolean * | right_click, | ||
| int * | x, | ||
| int * | y, | ||
| int * | dx, | ||
| int * | dy, | ||
| int * | dz_wheel | ||
| ) |
Get mouse inputs: left/right click, x, y, delta x/y since last call IF left or right button is pressed, wheel actions since last call
=== This is the func you can/should use to get mouse inputs inside the game main loop ===
Does NOT invoke SDL_PollEvent()
| event | A SDL_Event |
| left_click | Pointer to zboolean that will get left clicks |
| right_click | Pointer to zboolean that will get right clicks |
| x | Pointer to int that will get pointer x position |
| y | Pointer to int that will get pointer y position |
| dx | Pointer to int that will get delta x since last call |
| dy | Pointer to int that will get delta y since last call |
| dz_wheel | Pointer to int that will get delta z (wheel forward/backward motions) since last call |
| int lg_mouse_override_delta_threshold | ( | int | new_threshold | ) |
Override mouse delta threshold
Default value is MOUSE_DELTA_THRESHOLD defined in lg_mouse.h
| new_threshold |
| void lg_flush_mouse_events | ( | ) |
Flush mouse events
| void lg_wait_for_any_key_pressed_or_left_click | ( | ) |
Wait for any key pressed or left click