Subastra
Loading...
Searching...
No Matches
src
engine
input.h
Go to the documentation of this file.
1
#ifndef __H__ENGINE_INPUT__
2
#define __H__ENGINE_INPUT__
3
4
#include <string.h>
5
6
#include <GLFW/glfw3.h>
7
8
#include "../vec2i.h"
9
10
typedef
struct
{
11
i32
left, right, up,
down
;
12
}
input_t
;
13
14
static
void
input_init
(
input_t
*input) { memset(input, 0,
sizeof
(
input_t
)); }
15
16
static
vec2i
input_vector
(
input_t
*input) {
17
vec2i
ret;
18
ret.
x
= input->
right
- input->
left
;
19
ret.
y
= input->
up
- input->
down
;
20
return
ret;
21
}
22
23
#endif
i32
int32_t i32
Definition
defs.h:47
input_vector
static vec2i input_vector(input_t *input)
Definition
input.h:16
input_init
static void input_init(input_t *input)
Definition
input.h:14
input_t
Definition
input.h:10
input_t::down
i32 down
Definition
input.h:11
input_t::up
i32 up
Definition
input.h:11
input_t::right
i32 right
Definition
input.h:11
input_t::left
i32 left
Definition
input.h:11
vec2i
Definition
vec2i.h:7
vec2i::y
i32 y
Definition
vec2i.h:8
vec2i::x
i32 x
Definition
vec2i.h:8
Generated on Wed Jul 2 2025 16:57:45 for Subastra by
1.9.8