Yume Project
3.0
Touhou-inspired Danmaku game made in C only
Chargement...
Recherche...
Aucune correspondance
input.h
Aller à la documentation de ce fichier.
1
8
#pragma once
9
10
#include <raylib.h>
11
12
18
typedef
struct
InputConfig
{
19
// NOTE: gardez les memes noms de key pour config et State !
20
KeyboardKey
up
,
left
,
right
,
down
;
21
KeyboardKey
shoot
;
22
KeyboardKey
bomb
;
23
KeyboardKey
focus
;
24
KeyboardKey
skip
;
25
KeyboardKey
pause
;
26
KeyboardKey
validate
;
27
}
InputConfig
;
28
32
typedef
struct
KeyState
{
33
int
isPressed
;
34
int
isDown
;
35
int
isReleased
;
36
}
KeyState
;
37
43
typedef
struct
InputSystem
{
44
// NOTE: gardez les memes noms de key pour config et State !
45
InputConfig
keybinds
;
46
47
KeyState
up
,
left
,
right
,
down
;
48
KeyState
shoot
;
49
KeyState
bomb
;
50
KeyState
focus
;
51
KeyState
skip
;
52
KeyState
pause
;
53
KeyState
validate
;
54
}
InputSystem
;
55
56
/* Fonctions */
57
61
extern
void
input_initialize
(
InputSystem
*input);
62
66
extern
void
input_update
(
InputSystem
*input);
67
72
extern
int
isPressed
(
KeyState
key);
73
78
extern
int
isDown
(
KeyState
key);
79
84
extern
int
isReleased
(
KeyState
key);
85
90
extern
void
input_change_keybind
(KeyboardKey *key, KeyboardKey new_key);
input_initialize
void input_initialize(InputSystem *input)
Initialise le système d'entrée.
isDown
int isDown(KeyState key)
Vérifie si une touche est actuellement enfoncée.
isReleased
int isReleased(KeyState key)
Vérifie si une touche vient d'être relâchée.
isPressed
int isPressed(KeyState key)
Vérifie si une touche est actuellement pressée.
input_update
void input_update(InputSystem *input)
Met à jour le système d'entrée en fonction de l'état actuel des touches.
input_change_keybind
void input_change_keybind(KeyboardKey *key, KeyboardKey new_key)
Modifie la touche associée à une action.
InputConfig
Configuration des keybinds, modifiable dans les settings.
Definition
input.h:18
InputConfig::left
KeyboardKey left
Definition
input.h:20
InputConfig::down
KeyboardKey down
Definition
input.h:20
InputConfig::shoot
KeyboardKey shoot
Definition
input.h:21
InputConfig::skip
KeyboardKey skip
Definition
input.h:24
InputConfig::right
KeyboardKey right
Definition
input.h:20
InputConfig::bomb
KeyboardKey bomb
Definition
input.h:22
InputConfig::validate
KeyboardKey validate
Definition
input.h:26
InputConfig::up
KeyboardKey up
Definition
input.h:20
InputConfig::focus
KeyboardKey focus
Definition
input.h:23
InputConfig::pause
KeyboardKey pause
Definition
input.h:25
InputSystem
Système d'entrée complet contenant keybinds et états courants des touches.
Definition
input.h:43
InputSystem::up
KeyState up
Definition
input.h:47
InputSystem::focus
KeyState focus
Definition
input.h:50
InputSystem::shoot
KeyState shoot
Definition
input.h:48
InputSystem::keybinds
InputConfig keybinds
Definition
input.h:45
InputSystem::skip
KeyState skip
Definition
input.h:51
InputSystem::left
KeyState left
Definition
input.h:47
InputSystem::pause
KeyState pause
Definition
input.h:52
InputSystem::down
KeyState down
Definition
input.h:47
InputSystem::right
KeyState right
Definition
input.h:47
InputSystem::validate
KeyState validate
Definition
input.h:53
InputSystem::bomb
KeyState bomb
Definition
input.h:49
KeyState
État d'une touche/action (remplace les appels à IsKeyDown/IsKeyPressed/IsKeyReleased).
Definition
input.h:32
KeyState::isPressed
int isPressed
Definition
input.h:33
KeyState::isReleased
int isReleased
Definition
input.h:35
KeyState::isDown
int isDown
Definition
input.h:34
lib
internal
core
input.h
Généré par
1.16.1