This commit is contained in:
Dante
2026-05-22 01:09:33 -07:00
parent c0f390d015
commit 0a5075319f
893 changed files with 379593 additions and 1 deletions

View File

@ -0,0 +1,46 @@
#pragma once
#include <kinc/global.h>
/*! \file rotation.h
\brief Provides support for rotation-sensors.
*/
#ifdef __cplusplus
extern "C" {
#endif
/// <summary>
/// Sets the rotation-callback which is called when the device is rotated. Act quickly when this is called for a desktop-system.
/// </summary>
/// <param name="value">The callback</param>
KINC_FUNC void kinc_rotation_set_callback(void (*value)(float /*x*/, float /*y*/, float /*z*/));
void kinc_internal_on_rotation(float x, float y, float z);
#ifdef KINC_IMPLEMENTATION_INPUT
#define KINC_IMPLEMENTATION
#endif
#ifdef KINC_IMPLEMENTATION
#include <memory.h>
#include <stddef.h>
static void (*rotation_callback)(float /*x*/, float /*y*/, float /*z*/) = NULL;
void kinc_rotation_set_callback(void (*value)(float /*x*/, float /*y*/, float /*z*/)) {
rotation_callback = value;
}
void kinc_internal_on_rotation(float x, float y, float z) {
if (rotation_callback != NULL) {
rotation_callback(x, y, z);
}
}
#endif
#ifdef __cplusplus
}
#endif