Understanding the Gamepad-Mapping

Hello there,

in my game i implemented gamepad controlling.
But different gamepads behave differently.

This is were the MAPPING comes in i guess. But i just don´t understand how to use it.

in my code i load a mapping txt file with this text in the first line: “# Game Controller DB for SDL in 2.0.16 format”.
It has about 1800 controllers listed.

I guess this file is already loaded by default but i was not sure.

Anyway … all my controllers behave differently.
Button indexes or AnaogStick indexes are all very different form controller to controller.

So my question is: HOW do i make use of this loaded mapping file?
I checked almost all functions about this and just don´t see any that seem to have something to do with the mapping.

I would be very thankful if someone can explain the basic usage of the mapping to me.

thanks in advance!
cu
kai

Hi @uwi2k2 and welcome to the GLFW forum!

First of make sure to read the gamepad input documentation.

The gamepad mappings are used internally to map the gamepad inputs to the GLFWgamepadstate when you call the function glfwGetGamepadState.

Perfect!

Thank you very mutch!!!
You really help me.

kai