Package org.lwjgl.glfw
Class GLFWGamepadState
- All Implemented Interfaces:
AutoCloseable
,NativeResource
,Pointer
Describes the input state of a gamepad.
Layout
struct GLFWgamepadstate {
unsigned char buttons()
[15];
float axes()
[6];
}
- Since:
- version 3.3
-
Nested Class Summary
Nested classes/interfaces inherited from class org.lwjgl.system.Struct
Struct.StructValidation
Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer
Pointer.Default
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
The struct alignment in bytes.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct size in bytes.Fields inherited from interface org.lwjgl.system.Pointer
BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE
-
Constructor Summary
ConstructorDescriptionGLFWGamepadState
(ByteBuffer container) Creates aGLFWGamepadState
instance at the current position of the specifiedByteBuffer
container. -
Method Summary
Modifier and TypeMethodDescriptionaxes()
the states of each gamepad axis, in the range -1.0 to 1.0 inclusivefloat
axes
(int index) the states of each gamepad axis, in the range -1.0 to 1.0 inclusiveaxes
(int index, float value) Sets the specified value at the specified index of theaxes()
field.axes
(FloatBuffer value) Copies the specifiedFloatBuffer
to theaxes()
field.buttons()
byte
buttons
(int index) buttons
(int index, byte value) Sets the specified value at the specified index of thebuttons()
field.buttons
(ByteBuffer value) Copies the specifiedByteBuffer
to thebuttons()
field.static GLFWGamepadState
calloc()
Returns a newGLFWGamepadState
instance allocated withmemCalloc
.static GLFWGamepadState.Buffer
calloc
(int capacity) Returns a newGLFWGamepadState.Buffer
instance allocated withmemCalloc
.static GLFWGamepadState.Buffer
calloc
(int capacity, MemoryStack stack) Returns a newGLFWGamepadState.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static GLFWGamepadState
calloc
(MemoryStack stack) Returns a newGLFWGamepadState
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static GLFWGamepadState
Deprecated.static GLFWGamepadState.Buffer
callocStack
(int capacity) Deprecated.static GLFWGamepadState.Buffer
callocStack
(int capacity, MemoryStack stack) Deprecated.static GLFWGamepadState
callocStack
(MemoryStack stack) Deprecated.static GLFWGamepadState
create()
Returns a newGLFWGamepadState
instance allocated withBufferUtils
.static GLFWGamepadState.Buffer
create
(int capacity) Returns a newGLFWGamepadState.Buffer
instance allocated withBufferUtils
.static GLFWGamepadState
create
(long address) Returns a newGLFWGamepadState
instance for the specified memory address.static GLFWGamepadState.Buffer
create
(long address, int capacity) Create aGLFWGamepadState.Buffer
instance at the specified memory.static GLFWGamepadState
createSafe
(long address) static GLFWGamepadState.Buffer
createSafe
(long address, int capacity) static GLFWGamepadState
malloc()
Returns a newGLFWGamepadState
instance allocated withmemAlloc
.static GLFWGamepadState.Buffer
malloc
(int capacity) Returns a newGLFWGamepadState.Buffer
instance allocated withmemAlloc
.static GLFWGamepadState.Buffer
malloc
(int capacity, MemoryStack stack) Returns a newGLFWGamepadState.Buffer
instance allocated on the specifiedMemoryStack
.static GLFWGamepadState
malloc
(MemoryStack stack) Returns a newGLFWGamepadState
instance allocated on the specifiedMemoryStack
.static GLFWGamepadState
Deprecated.static GLFWGamepadState.Buffer
mallocStack
(int capacity) Deprecated.static GLFWGamepadState.Buffer
mallocStack
(int capacity, MemoryStack stack) Deprecated.static GLFWGamepadState
mallocStack
(MemoryStack stack) Deprecated.static FloatBuffer
naxes
(long struct) Unsafe version ofaxes()
.static float
naxes
(long struct, int index) Unsafe version ofaxes
.static void
naxes
(long struct, int index, float value) Unsafe version ofaxes
.static void
naxes
(long struct, FloatBuffer value) Unsafe version ofaxes
.static ByteBuffer
nbuttons
(long struct) Unsafe version ofbuttons()
.static byte
nbuttons
(long struct, int index) Unsafe version ofbuttons
.static void
nbuttons
(long struct, int index, byte value) Unsafe version ofbuttons
.static void
nbuttons
(long struct, ByteBuffer value) Unsafe version ofbuttons
.set
(ByteBuffer buttons, FloatBuffer axes) Initializes this struct with the specified values.set
(GLFWGamepadState src) Copies the specified struct data to this struct.int
sizeof()
Returnssizeof(struct)
.Methods inherited from class org.lwjgl.system.Pointer.Default
address, equals, hashCode, toString
Methods inherited from interface org.lwjgl.system.NativeResource
close, free
-
Field Details
-
SIZEOF
public static final int SIZEOFThe struct size in bytes. -
ALIGNOF
public static final int ALIGNOFThe struct alignment in bytes. -
BUTTONS
public static final int BUTTONSThe struct member offsets. -
AXES
public static final int AXESThe struct member offsets.
-
-
Constructor Details
-
GLFWGamepadState
Creates aGLFWGamepadState
instance at the current position of the specifiedByteBuffer
container. Changes to the buffer's content will be visible to the struct instance and vice versa.The created instance holds a strong reference to the container object.
-
-
Method Details
-
sizeof
public int sizeof()Description copied from class:Struct
Returnssizeof(struct)
.- Specified by:
sizeof
in classStruct<GLFWGamepadState>
-
buttons
-
buttons
public byte buttons(int index) -
axes
the states of each gamepad axis, in the range -1.0 to 1.0 inclusive -
axes
public float axes(int index) the states of each gamepad axis, in the range -1.0 to 1.0 inclusive -
buttons
Copies the specifiedByteBuffer
to thebuttons()
field. -
buttons
Sets the specified value at the specified index of thebuttons()
field. -
axes
Copies the specifiedFloatBuffer
to theaxes()
field. -
axes
Sets the specified value at the specified index of theaxes()
field. -
set
Initializes this struct with the specified values. -
set
Copies the specified struct data to this struct.- Parameters:
src
- the source struct- Returns:
- this struct
-
malloc
Returns a newGLFWGamepadState
instance allocated withmemAlloc
. The instance must be explicitly freed. -
calloc
Returns a newGLFWGamepadState
instance allocated withmemCalloc
. The instance must be explicitly freed. -
create
Returns a newGLFWGamepadState
instance allocated withBufferUtils
. -
create
Returns a newGLFWGamepadState
instance for the specified memory address. -
createSafe
-
malloc
Returns a newGLFWGamepadState.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
Returns a newGLFWGamepadState.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
Returns a newGLFWGamepadState.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
Create aGLFWGamepadState.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
-
mallocStack
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)
instead. -
callocStack
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)
instead. -
mallocStack
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)
instead. -
callocStack
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)
instead. -
mallocStack
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)
instead. -
callocStack
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)
instead. -
mallocStack
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)
instead. -
callocStack
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)
instead. -
malloc
Returns a newGLFWGamepadState
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
calloc
Returns a newGLFWGamepadState
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
malloc
Returns a newGLFWGamepadState.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
capacity
- the buffer capacitystack
- the stack from which to allocate
-
calloc
Returns a newGLFWGamepadState.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacitystack
- the stack from which to allocate
-
nbuttons
Unsafe version ofbuttons()
. -
nbuttons
public static byte nbuttons(long struct, int index) Unsafe version ofbuttons
. -
naxes
Unsafe version ofaxes()
. -
naxes
public static float naxes(long struct, int index) Unsafe version ofaxes
. -
nbuttons
Unsafe version ofbuttons
. -
nbuttons
public static void nbuttons(long struct, int index, byte value) Unsafe version ofbuttons
. -
naxes
Unsafe version ofaxes
. -
naxes
public static void naxes(long struct, int index, float value) Unsafe version ofaxes
.
-