public class GLFWGamepadState
extends org.lwjgl.system.Struct
implements org.lwjgl.system.NativeResource
buttons[15] – the states of each gamepad button, PRESS or RELEASEaxes[6] – the states of each gamepad axis, in the range -1.0 to 1.0 inclusive
struct GLFWgamepadstate {
unsigned char buttons[15];
float axes[6];
}| Modifier and Type | Class and Description |
|---|---|
static class |
GLFWGamepadState.Buffer
An array of
GLFWGamepadState structs. |
| Modifier and Type | Field and Description |
|---|---|
static int |
ALIGNOF
The struct alignment in bytes.
|
static int |
AXES
The struct member offsets.
|
static int |
BUTTONS
The struct member offsets.
|
static int |
SIZEOF
The struct size in bytes.
|
| Constructor and Description |
|---|
GLFWGamepadState(java.nio.ByteBuffer container)
Creates a
GLFWGamepadState instance at the current position of the specified ByteBuffer container. |
| Modifier and Type | Method and Description |
|---|---|
java.nio.FloatBuffer |
axes()
Returns a
FloatBuffer view of the axes field. |
GLFWGamepadState |
axes(java.nio.FloatBuffer value)
Copies the specified
FloatBuffer to the axes field. |
float |
axes(int index)
Returns the value at the specified index of the
axes field. |
GLFWGamepadState |
axes(int index,
float value)
Sets the specified value at the specified index of the
axes field. |
java.nio.ByteBuffer |
buttons()
Returns a
ByteBuffer view of the buttons field. |
GLFWGamepadState |
buttons(java.nio.ByteBuffer value)
Copies the specified
ByteBuffer to the buttons field. |
byte |
buttons(int index)
Returns the value at the specified index of the
buttons field. |
GLFWGamepadState |
buttons(int index,
byte value)
Sets the specified value at the specified index of the
buttons field. |
static GLFWGamepadState |
calloc()
Returns a new
GLFWGamepadState instance allocated with memCalloc. |
static GLFWGamepadState.Buffer |
calloc(int capacity)
Returns a new
GLFWGamepadState.Buffer instance allocated with memCalloc. |
static GLFWGamepadState |
callocStack()
Returns a new
GLFWGamepadState instance allocated on the thread-local MemoryStack and initializes all its bits to zero. |
static GLFWGamepadState.Buffer |
callocStack(int capacity)
Returns a new
GLFWGamepadState.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero. |
static GLFWGamepadState.Buffer |
callocStack(int capacity,
org.lwjgl.system.MemoryStack stack)
Returns a new
GLFWGamepadState.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero. |
static GLFWGamepadState |
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a new
GLFWGamepadState instance allocated on the specified MemoryStack and initializes all its bits to zero. |
static GLFWGamepadState |
create()
Returns a new
GLFWGamepadState instance allocated with BufferUtils. |
static GLFWGamepadState.Buffer |
create(int capacity)
Returns a new
GLFWGamepadState.Buffer instance allocated with BufferUtils. |
static GLFWGamepadState |
create(long address)
Returns a new
GLFWGamepadState instance for the specified memory address. |
static GLFWGamepadState.Buffer |
create(long address,
int capacity)
Create a
GLFWGamepadState.Buffer instance at the specified memory. |
static GLFWGamepadState |
createSafe(long address)
|
static GLFWGamepadState.Buffer |
createSafe(long address,
int capacity)
|
static GLFWGamepadState |
malloc()
Returns a new
GLFWGamepadState instance allocated with memAlloc. |
static GLFWGamepadState.Buffer |
malloc(int capacity)
Returns a new
GLFWGamepadState.Buffer instance allocated with memAlloc. |
static GLFWGamepadState |
mallocStack()
Returns a new
GLFWGamepadState instance allocated on the thread-local MemoryStack. |
static GLFWGamepadState.Buffer |
mallocStack(int capacity)
Returns a new
GLFWGamepadState.Buffer instance allocated on the thread-local MemoryStack. |
static GLFWGamepadState.Buffer |
mallocStack(int capacity,
org.lwjgl.system.MemoryStack stack)
Returns a new
GLFWGamepadState.Buffer instance allocated on the specified MemoryStack. |
static GLFWGamepadState |
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a new
GLFWGamepadState instance allocated on the specified MemoryStack. |
static java.nio.FloatBuffer |
naxes(long struct)
Unsafe version of
axes(). |
static void |
naxes(long struct,
java.nio.FloatBuffer value)
Unsafe version of
axes. |
static float |
naxes(long struct,
int index)
Unsafe version of
axes. |
static void |
naxes(long struct,
int index,
float value)
Unsafe version of
axes. |
static java.nio.ByteBuffer |
nbuttons(long struct)
Unsafe version of
buttons(). |
static void |
nbuttons(long struct,
java.nio.ByteBuffer value)
Unsafe version of
buttons. |
static byte |
nbuttons(long struct,
int index)
Unsafe version of
buttons. |
static void |
nbuttons(long struct,
int index,
byte value)
Unsafe version of
buttons. |
GLFWGamepadState |
set(java.nio.ByteBuffer buttons,
java.nio.FloatBuffer axes)
Initializes this struct with the specified values.
|
GLFWGamepadState |
set(GLFWGamepadState src)
Copies the specified struct data to this struct.
|
int |
sizeof() |
public static final int SIZEOF
public static final int ALIGNOF
public static final int BUTTONS
public static final int AXES
public GLFWGamepadState(java.nio.ByteBuffer container)
GLFWGamepadState instance at the current position of the specified ByteBuffer 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.
public int sizeof()
sizeof in class org.lwjgl.system.Structpublic java.nio.ByteBuffer buttons()
ByteBuffer view of the buttons field.public byte buttons(int index)
buttons field.public java.nio.FloatBuffer axes()
FloatBuffer view of the axes field.public float axes(int index)
axes field.public GLFWGamepadState buttons(java.nio.ByteBuffer value)
ByteBuffer to the buttons field.public GLFWGamepadState buttons(int index, byte value)
buttons field.public GLFWGamepadState axes(java.nio.FloatBuffer value)
FloatBuffer to the axes field.public GLFWGamepadState axes(int index, float value)
axes field.public GLFWGamepadState set(java.nio.ByteBuffer buttons, java.nio.FloatBuffer axes)
public GLFWGamepadState set(GLFWGamepadState src)
src - the source structpublic static GLFWGamepadState malloc()
GLFWGamepadState instance allocated with memAlloc. The instance must be explicitly freed.public static GLFWGamepadState calloc()
GLFWGamepadState instance allocated with memCalloc. The instance must be explicitly freed.public static GLFWGamepadState create()
GLFWGamepadState instance allocated with BufferUtils.public static GLFWGamepadState create(long address)
GLFWGamepadState instance for the specified memory address.@Nullable public static GLFWGamepadState createSafe(long address)
public static GLFWGamepadState.Buffer malloc(int capacity)
GLFWGamepadState.Buffer instance allocated with memAlloc. The instance must be explicitly freed.capacity - the buffer capacitypublic static GLFWGamepadState.Buffer calloc(int capacity)
GLFWGamepadState.Buffer instance allocated with memCalloc. The instance must be explicitly freed.capacity - the buffer capacitypublic static GLFWGamepadState.Buffer create(int capacity)
GLFWGamepadState.Buffer instance allocated with BufferUtils.capacity - the buffer capacitypublic static GLFWGamepadState.Buffer create(long address, int capacity)
GLFWGamepadState.Buffer instance at the specified memory.address - the memory addresscapacity - the buffer capacity@Nullable public static GLFWGamepadState.Buffer createSafe(long address, int capacity)
public static GLFWGamepadState mallocStack()
GLFWGamepadState instance allocated on the thread-local MemoryStack.public static GLFWGamepadState callocStack()
GLFWGamepadState instance allocated on the thread-local MemoryStack and initializes all its bits to zero.public static GLFWGamepadState mallocStack(org.lwjgl.system.MemoryStack stack)
GLFWGamepadState instance allocated on the specified MemoryStack.stack - the stack from which to allocatepublic static GLFWGamepadState callocStack(org.lwjgl.system.MemoryStack stack)
GLFWGamepadState instance allocated on the specified MemoryStack and initializes all its bits to zero.stack - the stack from which to allocatepublic static GLFWGamepadState.Buffer mallocStack(int capacity)
GLFWGamepadState.Buffer instance allocated on the thread-local MemoryStack.capacity - the buffer capacitypublic static GLFWGamepadState.Buffer callocStack(int capacity)
GLFWGamepadState.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero.capacity - the buffer capacitypublic static GLFWGamepadState.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
GLFWGamepadState.Buffer instance allocated on the specified MemoryStack.stack - the stack from which to allocatecapacity - the buffer capacitypublic static GLFWGamepadState.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
GLFWGamepadState.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.stack - the stack from which to allocatecapacity - the buffer capacitypublic static java.nio.ByteBuffer nbuttons(long struct)
buttons().public static byte nbuttons(long struct,
int index)
buttons.public static java.nio.FloatBuffer naxes(long struct)
axes().public static float naxes(long struct,
int index)
axes.public static void nbuttons(long struct,
java.nio.ByteBuffer value)
buttons.public static void nbuttons(long struct,
int index,
byte value)
buttons.public static void naxes(long struct,
java.nio.FloatBuffer value)
axes.public static void naxes(long struct,
int index,
float value)
axes.Copyright LWJGL. All Rights Reserved. License terms.