MLX42 1.0
MLX42
|
#include "MLX42/MLX42_Int.h"
Go to the source code of this file.
Functions | |
static void | mlx_scroll_cb (GLFWwindow *window, double xoffset, double yoffset) |
static void | mlx_mouse_cb (GLFWwindow *window, int32_t button, int32_t action, int32_t mods) |
static void | mlx_cursor_cb (GLFWwindow *window, double xpos, double ypos) |
void | mlx_scroll_hook (mlx_t *mlx, mlx_scrollfunc func, void *param) |
void | mlx_mouse_hook (mlx_t *mlx, mlx_mousefunc func, void *param) |
void | mlx_cursor_hook (mlx_t *mlx, mlx_cursorfunc func, void *param) |
bool | mlx_is_mouse_down (mlx_t *mlx, mouse_key_t key) |
void | mlx_set_mouse_pos (mlx_t *mlx, int32_t x, int32_t y) |
void | mlx_get_mouse_pos (mlx_t *mlx, int32_t *x, int32_t *y) |
|
static |
Definition at line 33 of file mlx_mouse.c.
void mlx_cursor_hook | ( | mlx_t * | mlx, |
mlx_cursorfunc | func, | ||
void * | param | ||
) |
This function sets the cursor callback, which is called when the mouse position changes. Position is relative to the window.
[in] | mlx | The MLX instance handle. |
[in] | func | The cursor callback function. |
[in] | param | An additional optional parameter. |
Definition at line 65 of file mlx_mouse.c.
Returns the current, relative, mouse cursor position on the window, starting from the top left corner.
Negative values or values greater than window width or height indicate that it is outside the window.
[in] | mlx | The MLX instance handle. |
[out] | x | The position. |
[out] | y | The position. |
Definition at line 90 of file mlx_mouse.c.
bool mlx_is_mouse_down | ( | mlx_t * | mlx, |
mouse_key_t | key | ||
) |
Checks whether a mouse button is pressed or not.
[in] | mlx | The MLX instance handle. |
[in] | key | A specific mouse key. e.g MLX_MOUSE_BUTTON_0 |
Definition at line 76 of file mlx_mouse.c.
|
static |
Definition at line 25 of file mlx_mouse.c.
void mlx_mouse_hook | ( | mlx_t * | mlx, |
mlx_mousefunc | func, | ||
void * | param | ||
) |
This function sets the mouse callback, which is called when a mouse does any sort of action such as pressing a key.
[in] | mlx | The MLX instance handle. |
[in] | func | The mouse callback function. |
[in] | param | An additional optional parameter. |
Definition at line 54 of file mlx_mouse.c.
|
static |
Definition at line 17 of file mlx_mouse.c.
void mlx_scroll_hook | ( | mlx_t * | mlx, |
mlx_scrollfunc | func, | ||
void * | param | ||
) |
This function sets the scroll callback, which is called when a scrolling device is used, such as a mouse wheel.
[in] | mlx | The MLX instance handle. |
[in] | func | The scroll wheel callback function. |
[in] | param | An additional optional parameter. |
Definition at line 43 of file mlx_mouse.c.
Sets the mouse position.
[in] | mlx | The MLX instance handle. |
[in] | pos | The position. |
Definition at line 83 of file mlx_mouse.c.