Kore
Loading...
Searching...
No Matches
rotation.h
Go to the documentation of this file.
1#pragma once
2
3#include <kinc/global.h>
4
8
9#ifdef __cplusplus
10extern "C" {
11#endif
12
17KINC_FUNC void kinc_rotation_set_callback(void (*value)(float /*x*/, float /*y*/, float /*z*/));
18
19void kinc_internal_on_rotation(float x, float y, float z);
20
21#ifdef KINC_IMPLEMENTATION_INPUT
22#define KINC_IMPLEMENTATION
23#endif
24
25#ifdef KINC_IMPLEMENTATION
26
27#include <memory.h>
28#include <stddef.h>
29
30static void (*rotation_callback)(float /*x*/, float /*y*/, float /*z*/) = NULL;
31
32void kinc_rotation_set_callback(void (*value)(float /*x*/, float /*y*/, float /*z*/)) {
33 rotation_callback = value;
34}
35
36void kinc_internal_on_rotation(float x, float y, float z) {
37 if (rotation_callback != NULL) {
38 rotation_callback(x, y, z);
39 }
40}
41
42#endif
43
44#ifdef __cplusplus
45}
46#endif
Provides basic functionality that's used all over the place. There's usually no need to manually incl...
KINC_FUNC void kinc_rotation_set_callback(void(*value)(float, float, float))
Sets the rotation-callback which is called when the device is rotated. Act quickly when this is calle...