Gama C Library
Gama C API Documentation
Main Page
Data Structures
Files
Examples
File List
Globals
lib
gama
mouse.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
position.h
"
4
#include <stdint.h>
5
6
/**
7
* @brief Structure representing the current state of the mouse.
8
*
9
* This struct holds various properties related to mouse input, including
10
* its position, movement, and button click states.
11
*/
12
struct
_gmMouse
{
13
gmPos
position
;
/**< The current X,Y coordinates of the mouse. */
14
gmPos
lastPosition
;
/**< The X,Y coordinates of the mouse in the previous frame. */
15
gmPos
movement
;
/**< The change in mouse position since the last frame. */
16
17
uint8_t
clicked
;
/**< True (1) if the mouse button was just pressed in this frame, otherwise false (0). */
18
uint8_t
down
;
/**< True (1) if the mouse button is currently held down, otherwise false (0). */
19
};
20
21
/**
22
* @brief Global instance of the mouse state.
23
*
24
* This variable is updated automatically by the engine and provides
25
* access to the current mouse input.
26
* @example
27
* if (gm_mouse.clicked) {
28
* // Mouse was just clicked
29
* }
30
* double mx = gm_mouse.position.x;
31
*/
32
struct
_gmMouse
gm_mouse
= {
33
.position = {0, 0},
34
.lastPosition = {0, 0},
35
.movement = {0, 0},
36
.clicked = 0,
37
.down = 0,
38
};
gm_mouse
struct _gmMouse gm_mouse
Definition
mouse.h:32
position.h
_gmMouse
Structure representing the current state of the mouse.
Definition
mouse.h:12
_gmMouse::down
uint8_t down
Definition
mouse.h:18
_gmMouse::position
gmPos position
Definition
mouse.h:13
_gmMouse::movement
gmPos movement
Definition
mouse.h:15
_gmMouse::clicked
uint8_t clicked
Definition
mouse.h:17
_gmMouse::lastPosition
gmPos lastPosition
Definition
mouse.h:14
gmPos
Represents a 2D position or vector.
Definition
position.h:8
Generated by
1.15.0