I am using a Xbox One controller. So I followed the Input handling guide
https://github.com/LWJGL/lwjgl3-wiki/wiki/2.6.3-Input-handling-with-GLFW#joystick-input to learn about it. Now when I want to use D-Pad Right, D-Pad Down or D-Pad Left I get an IndexOutOfBoundsException.
When I use limits() it returns 14 how it should. So in the ByteBuffer index 11,12 and 13 are unreachable using lwjgl 3.0.0b.
I don´t know what to do because everything else works fine ! Is it a GLFW issue or do I miss something?
> Exception in thread "Game Thread" java.lang.IndexOutOfBoundsException
at java.nio.Buffer.checkIndex(Buffer.java:546)
at java.nio.DirectByteBuffer.getInt(DirectByteBuffer.java:685)
at engine.input.XboxController.DPad_Down_Button_Pressed(XboxController.java:68)
at example.Pong.loop(Pong.java:49)
at example.Pong.update(Pong.java:34)
at example.Pong.run(Pong.java:118)
at java.lang.Thread.run(Thread.java:745)
One more. Shouldn´t the Buffer be bigger? Like 16 entries for the left and right trigger?
And one fix for the guide. It would be nice to start counting from 0. Because later there is the sentence "On index 8 and 9. It does only return 1 when you press down the stick, not moving it around." which is correct when you start by zero. But it is a little bit confusing if you look at the table above.
Hope you can help me.