Skip to content

Commit

Permalink
Merge branch 'main' of ssh://github.com/Kode/Kinc
Browse files Browse the repository at this point in the history
  • Loading branch information
RobDangerous committed Feb 3, 2025
2 parents 127a3f5 + eb99497 commit fb1b02d
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Backends/System/Android/Sources/kinc/backend/system.c.h
Original file line number Diff line number Diff line change
Expand Up @@ -1130,6 +1130,8 @@ void kinc_login() {}

void kinc_unlock_achievement(int id) {}

void kinc_gamepad_set_count(int count) {}

bool kinc_gamepad_connected(int num) {
return num == 0;
}
Expand Down
2 changes: 2 additions & 0 deletions Backends/System/Emscripten/Sources/kinc/backend/gamepad.c.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include <kinc/input/gamepad.h>

void kinc_gamepad_set_count(int count) {}

const char *kinc_gamepad_vendor(int gamepad) {
return "None";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ void Kore::updateHIDGamepads() {

void Kore::closeHIDGamepads() {}

void kinc_gamepad_set_count(int count) {}

const char *kinc_gamepad_vendor(int gamepad) {
return "Linux gamepad";
}
Expand Down
2 changes: 2 additions & 0 deletions Backends/System/Linux/Sources/kinc/backend/gamepad.c.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ void kinc_linux_closeHIDGamepads() {
HIDGamepadUdevHelper_close(&udev_helper);
}

void kinc_gamepad_set_count(int count) {}

const char *kinc_gamepad_vendor(int gamepad) {
return "Linux gamepad";
}
Expand Down
2 changes: 2 additions & 0 deletions Backends/System/Windows/Sources/kinc/backend/system.c.h
Original file line number Diff line number Diff line change
Expand Up @@ -1288,6 +1288,8 @@ void kinc_login(void) {}

void kinc_unlock_achievement(int id) {}

void kinc_gamepad_set_count(int count) {}

bool kinc_gamepad_connected(int num) {
return isXInputGamepad(num) || isDirectInputGamepad(num);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,8 @@ void kinc_login() {}

void kinc_unlock_achievement(int id) {}

void kinc_gamepad_set_count(int count) {}

bool kinc_gamepad_connected(int num) {
return true;
}
Expand Down
2 changes: 2 additions & 0 deletions Backends/System/iOS/Sources/kinc/backend/system.m.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ void kinc_login(void) {}

void kinc_unlock_achievement(int id) {}

void kinc_gamepad_set_count(int count) {}

const char *kinc_gamepad_vendor(int gamepad) {
return "nobody";
}
Expand Down
2 changes: 2 additions & 0 deletions Backends/System/macOS/Sources/kinc/backend/system.c.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ void kinc_login(void) {}

void kinc_unlock_achievement(int id) {}

void kinc_gamepad_set_count(int count) {}

bool kinc_gamepad_connected(int num) {
return true;
}
Expand Down
7 changes: 7 additions & 0 deletions Sources/kinc/input/gamepad.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ KINC_FUNC void kinc_gamepad_set_axis_callback(void (*value)(int /*gamepad*/, int
/// <param name="userdata">Userdata you will receive back as the 4th callback parameter</param>
KINC_FUNC void kinc_gamepad_set_button_callback(void (*value)(int /*gamepad*/, int /*button*/, float /*value*/, void * /*userdata*/), void *userdata);

/// <summary>
/// Sets the preferred number of gamepads for the application to work properly. The platform may display a system
/// dialog to ask for more players to join the party. The operation is not guaranteed to succeed.
/// </summary>
/// <param name="count">The desired number of connected gamepads</param>
KINC_FUNC void kinc_gamepad_set_count(int count);

/// <summary>
/// Returns a vendor-name for a gamepad.
/// </summary>
Expand Down

0 comments on commit fb1b02d

Please sign in to comment.