java.lang.Object
overrungl.Pointer
overrungl.Struct
overrungl.glfw.GLFWGamepadState
- All Implemented Interfaces:
Addressable
GLFWGamepadState relies on preview features of the Java platform:
GLFWGamepadStaterefers to one or more preview APIs:MemorySegment,SegmentAllocator,SequenceLayout,StructLayout.
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final SequenceLayoutPREVIEWThe struct member layout.static final SequenceLayoutPREVIEWThe struct member layout.static final StructLayoutPREVIEWThe struct layout.Fields inherited from class overrungl.Pointer
address, allocator, managedSegment -
Constructor Summary
ConstructorsConstructorDescriptionGLFWGamepadState(MemorySegmentPREVIEW address, SegmentAllocatorPREVIEW allocator) Create aGLFWgamepadstateinstance. -
Method Summary
Modifier and TypeMethodDescriptionfloataxe(int index) Gets the axe state at the given index.float[]axes()Gets the axe state array.booleanbutton(int index) Gets the button state at the given index.byte[]buttons()Gets the button state array.static GLFWGamepadStatecreate(SegmentAllocatorPREVIEW allocator) Creates aGLFWgamepadstateinstance with the given allocator.
-
Field Details
-
BUTTONS_LAYOUT
The struct member layout. -
AXES_LAYOUT
The struct member layout. -
LAYOUT
The struct layout.
-
-
Constructor Details
-
GLFWGamepadState
Create aGLFWgamepadstateinstance.- Parameters:
address- the address.allocator- the allocator of this address.
-
-
Method Details
-
create
Creates aGLFWgamepadstateinstance 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,
PRESSorRELEASE.
-
button
public boolean button(int index) Gets the button state at the given index.- Parameters:
index- the index- Returns:
- the state,
PRESSorRELEASE
-
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
-
GLFWGamepadStatewhen preview features are enabled.