jazz2-native icon indicating copy to clipboard operation
jazz2-native copied to clipboard

Loading gamepad mappings from gamecontrollerdb.txt

Open vanfanel opened this issue 1 month ago • 6 comments

Jazz² Resurrection version

Latest GIT code

Problem or limitation

Hi there,

SDL2 support a finite number of gamepads on it's database. In order to use gamepads not included in SDL2 database, what other engines do is calling: SDL_GameControllerAddMappingsFromFile("gamecontrollerdb.txt")

before this typical call: SDL_GameControllerOpen(0);

...which in Jazz2 seems to be done here: https://github.com/deathkiller/jazz2-native/blob/8d4a73fe9f1dfb2f4231cba8595e12777950cbbf/Sources/nCine/Backends/ImGuiSdlInput.cpp#L477

However, adding SDL_GameControllerAddMappingsFromFile("gamecontrollerdb.txt") there seems a bit strange, because it seems to be part of imgui. I mean, should I do it here or in imgui repository?

Proposed solution

Purposed solution is above, but I am not sure it's correct.

vanfanel avatar May 24 '24 16:05 vanfanel