Loading...
Searching...
No Matches
mouse.h
Go to the documentation of this file.
#ifndef ARC_GRAPHICS_MOUSE_H_
#define ARC_GRAPHICS_MOUSE_H_
#ifdef __cplusplus
extern "C" {
#endif
#include "arc/math/point.h"
#include <stdint.h>
/**
* @brief predefien ARC_Input so as not to get circular reference
*/
typedef struct ARC_Input ARC_Input;
typedef struct ARC_Mouse ARC_Mouse;
typedef enum ARC_MouseState {
ARC_MOUSE_NONE,
ARC_MOUSE_PRESSED,
ARC_MOUSE_RELEASED
} ARC_MouseState;
typedef enum ARC_MouseButton {
ARC_MOUSE_LEFT = 0,
ARC_MOUSE_MIDDLE = 1,
ARC_MOUSE_RIGHT = 2,
ARC_MOUSE_X1 = 3,
ARC_MOUSE_X2 = 4
} ARC_MouseButton;
#define ARC_MOUSE_BUTTON_NUM 5
void ARC_Mouse_CreateWithInput(ARC_Mouse **mouse, ARC_Input *input);
void ARC_Mouse_Destroy(ARC_Mouse *mouse);
void ARC_Mouse_Update(ARC_Mouse *mouse);
ARC_Point *ARC_Mouse_GetCoords(ARC_Mouse *mouse);
ARC_MouseState ARC_Mouse_GetState(ARC_Mouse *mouse, ARC_MouseButton button);
int32_t *ARC_Mouse_GetScrollY(ARC_Mouse *mouse);
#ifdef __cplusplus
}
#endif
#endif // !ARC_GRAPHICS_MOUSE_H_
ARC_Mouse_GetState
ARC_MouseState ARC_Mouse_GetState(ARC_Mouse *mouse, ARC_MouseButton button)
Definition mouse.c:99
ARC_Mouse_GetCoords
ARC_Point * ARC_Mouse_GetCoords(ARC_Mouse *mouse)
Definition mouse.c:95
ARC_MouseButton
ARC_MouseButton
Definition mouse.h:24
ARC_MOUSE_X2
@ ARC_MOUSE_X2
Definition mouse.h:29
ARC_MOUSE_LEFT
@ ARC_MOUSE_LEFT
Definition mouse.h:25
ARC_MOUSE_RIGHT
@ ARC_MOUSE_RIGHT
Definition mouse.h:27
ARC_MOUSE_X1
@ ARC_MOUSE_X1
Definition mouse.h:28
ARC_MOUSE_MIDDLE
@ ARC_MOUSE_MIDDLE
Definition mouse.h:26
ARC_Mouse_GetScrollY
int32_t * ARC_Mouse_GetScrollY(ARC_Mouse *mouse)
Definition mouse.c:103
ARC_MouseState
ARC_MouseState
Definition mouse.h:18
ARC_MOUSE_RELEASED
@ ARC_MOUSE_RELEASED
Definition mouse.h:21
ARC_MOUSE_PRESSED
@ ARC_MOUSE_PRESSED
Definition mouse.h:20
ARC_MOUSE_NONE
@ ARC_MOUSE_NONE
Definition mouse.h:19
ARC_Mouse_Update
void ARC_Mouse_Update(ARC_Mouse *mouse)
Definition mouse.c:61
ARC_Mouse_Destroy
void ARC_Mouse_Destroy(ARC_Mouse *mouse)
Definition mouse.c:31
ARC_Mouse_CreateWithInput
void ARC_Mouse_CreateWithInput(ARC_Mouse **mouse, ARC_Input *input)
Definition mouse.c:12
point.h
ARC_Input
Definition input.h:8
ARC_Mouse
Definition mouse.h:8
ARC_Point
Definition point.h:10