Class GLFWGamepadState

java.lang.Object
overrungl.Pointer
overrungl.Struct
overrungl.glfw.GLFWGamepadState
All Implemented Interfaces:
Addressable

public class GLFWGamepadState extends Struct
GLFWGamepadState relies on preview features of the Java platform:
Programs can only use GLFWGamepadState when preview features are enabled.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
This describes the input state of a gamepad.

Layout


 struct GLFWgamepadstate {
     unsigned char buttons[15];
     float axes[6];
 }
Since:
0.1.0
Author:
squid233
  • Field Details

  • Constructor Details

    • GLFWGamepadState

      public GLFWGamepadState(MemorySegmentPREVIEW address, SegmentAllocatorPREVIEW allocator)
      Create a GLFWgamepadstate instance.
      Parameters:
      address - the address.
      allocator - the allocator of this address.
  • Method Details

    • create

      public static GLFWGamepadState create(SegmentAllocatorPREVIEW allocator)
      Creates a GLFWgamepadstate instance with the given allocator.
      Parameters:
      allocator - the allocator
      Returns:
      the instance
    • buttons

      public byte[] buttons()
      Gets the button state array.
      Returns:
      The states of each gamepad button, PRESS or RELEASE.
    • button

      public boolean button(int index)
      Gets the button state at the given index.
      Parameters:
      index - the index
      Returns:
      the state, PRESS or RELEASE
    • axes

      public float[] axes()
      Gets the axe state array.
      Returns:
      The states of each gamepad axis, in the range -1.0 to 1.0 inclusive.
    • axe

      public float axe(int index)
      Gets the axe state at the given index.
      Parameters:
      index - the index
      Returns:
      the state, in the range -1.0 to 1.0 inclusive