Kore 3
Loading...
Searching...
No Matches
gamepad.h
Go to the documentation of this file.
1#ifndef KORE_INPUT_GAMEPAD_HEADER
2#define KORE_INPUT_GAMEPAD_HEADER
3
4#include <kore3/global.h>
5
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
14#define KORE_GAMEPAD_MAX_COUNT 12
15
21KORE_FUNC void kore_gamepad_set_connect_callback(void (*value)(int /*gamepad*/, void * /*userdata*/), void *userdata);
22
28KORE_FUNC void kore_gamepad_set_disconnect_callback(void (*value)(int /*gamepad*/, void * /*userdata*/), void *userdata);
29
35KORE_FUNC void kore_gamepad_set_axis_callback(void (*value)(int /*gamepad*/, int /*axis*/, float /*value*/, void * /*userdata*/), void *userdata);
36
42KORE_FUNC void kore_gamepad_set_button_callback(void (*value)(int /*gamepad*/, int /*button*/, float /*value*/, void * /*userdata*/), void *userdata);
43
49KORE_FUNC const char *kore_gamepad_vendor(int gamepad);
50
56KORE_FUNC const char *kore_gamepad_product_name(int gamepad);
57
63KORE_FUNC bool kore_gamepad_connected(int gamepad);
64
71KORE_FUNC void kore_gamepad_rumble(int gamepad, float left, float right);
72
73void kore_internal_gamepad_trigger_connect(int gamepad);
74void kore_internal_gamepad_trigger_disconnect(int gamepad);
75void kore_internal_gamepad_trigger_axis(int gamepad, int axis, float value);
76void kore_internal_gamepad_trigger_button(int gamepad, int button, float value);
77
78#ifdef __cplusplus
79}
80#endif
81
82#endif
KORE_FUNC const char * kore_gamepad_vendor(int gamepad)
Returns a vendor-name for a gamepad.
KORE_FUNC void kore_gamepad_set_connect_callback(void(*value)(int, void *), void *userdata)
Sets the gamepad-connect-callback which is called when a gamepad is connected.
KORE_FUNC void kore_gamepad_set_disconnect_callback(void(*value)(int, void *), void *userdata)
Sets the gamepad-disconnect-callback which is called when a gamepad is disconnected.
KORE_FUNC void kore_gamepad_rumble(int gamepad, float left, float right)
Rumbles a gamepad. Careful here because it might just fall off your table.
KORE_FUNC void kore_gamepad_set_axis_callback(void(*value)(int, int, float, void *), void *userdata)
Sets the gamepad-axis-callback which is called with data about changing gamepad-sticks.
KORE_FUNC bool kore_gamepad_connected(int gamepad)
Checks whether a gamepad is connected.
KORE_FUNC const char * kore_gamepad_product_name(int gamepad)
Returns a name for a gamepad.
KORE_FUNC void kore_gamepad_set_button_callback(void(*value)(int, int, float, void *), void *userdata)
Sets the gamepad-button-callback which is called with data about changing gamepad-buttons.
Provides basic functionality that's used all over the place. There's usually no need to manually incl...