Package org.lwjgl.glfw
Class GLFWGamepadState
- All Implemented Interfaces:
AutoCloseable,NativeResource,Pointer
struct GLFWgamepadstate {
unsigned char buttons[15];
float axes[6];
}-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.lwjgl.system.Struct
Struct.StructValidationNested classes/interfaces inherited from interface org.lwjgl.system.Pointer
Pointer.Default -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe struct alignment in bytes.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct size in bytes.Fields inherited from interface org.lwjgl.system.Pointer
BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionGLFWGamepadState(ByteBuffer container) Creates aGLFWGamepadStateinstance at the current position of the specifiedByteBuffercontainer. -
Method Summary
Modifier and TypeMethodDescriptionaxes()floataxes(int index) axes(int index, float value) Sets the specified value at the specified index of theaxesfield.axes(FloatBuffer value) Copies the specifiedFloatBufferto theaxesfield.buttons()bytebuttons(int index) buttons(int index, byte value) Sets the specified value at the specified index of thebuttonsfield.buttons(ByteBuffer value) Copies the specifiedByteBufferto thebuttonsfield.static GLFWGamepadStatecalloc()Returns a newGLFWGamepadStateinstance allocated withmemCalloc.static GLFWGamepadState.Buffercalloc(int capacity) Returns a newGLFWGamepadState.Bufferinstance allocated withmemCalloc.static GLFWGamepadState.Buffercalloc(int capacity, MemoryStack stack) Returns a newGLFWGamepadState.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static GLFWGamepadStatecalloc(MemoryStack stack) Returns a newGLFWGamepadStateinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static GLFWGamepadStateDeprecated.static GLFWGamepadState.BuffercallocStack(int capacity) Deprecated.static GLFWGamepadState.BuffercallocStack(int capacity, MemoryStack stack) Deprecated.static GLFWGamepadStatecallocStack(MemoryStack stack) Deprecated.static GLFWGamepadStatecreate()Returns a newGLFWGamepadStateinstance allocated withBufferUtils.static GLFWGamepadState.Buffercreate(int capacity) Returns a newGLFWGamepadState.Bufferinstance allocated withBufferUtils.static GLFWGamepadStatecreate(long address) Returns a newGLFWGamepadStateinstance for the specified memory address.static GLFWGamepadState.Buffercreate(long address, int capacity) Create aGLFWGamepadState.Bufferinstance at the specified memory.static @Nullable GLFWGamepadStatecreateSafe(long address) static @Nullable GLFWGamepadState.BuffercreateSafe(long address, int capacity) static GLFWGamepadStatemalloc()Returns a newGLFWGamepadStateinstance allocated withmemAlloc.static GLFWGamepadState.Buffermalloc(int capacity) Returns a newGLFWGamepadState.Bufferinstance allocated withmemAlloc.static GLFWGamepadState.Buffermalloc(int capacity, MemoryStack stack) Returns a newGLFWGamepadState.Bufferinstance allocated on the specifiedMemoryStack.static GLFWGamepadStatemalloc(MemoryStack stack) Returns a newGLFWGamepadStateinstance allocated on the specifiedMemoryStack.static GLFWGamepadStateDeprecated.static GLFWGamepadState.BuffermallocStack(int capacity) Deprecated.static GLFWGamepadState.BuffermallocStack(int capacity, MemoryStack stack) Deprecated.static GLFWGamepadStatemallocStack(MemoryStack stack) Deprecated.static FloatBuffernaxes(long struct) Unsafe version ofaxes().static floatnaxes(long struct, int index) Unsafe version ofaxes.static voidnaxes(long struct, int index, float value) Unsafe version ofaxes.static voidnaxes(long struct, FloatBuffer value) Unsafe version ofaxes.static ByteBuffernbuttons(long struct) Unsafe version ofbuttons().static bytenbuttons(long struct, int index) Unsafe version ofbuttons.static voidnbuttons(long struct, int index, byte value) Unsafe version ofbuttons.static voidnbuttons(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.intsizeof()Returnssizeof(struct).Methods inherited from class org.lwjgl.system.Pointer.Default
address, equals, hashCode, toStringMethods 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 aGLFWGamepadStateinstance at the current position of the specifiedByteBuffercontainer. 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:StructReturnssizeof(struct).- Specified by:
sizeofin classStruct<GLFWGamepadState>
-
buttons
- Returns:
- a
ByteBufferview of thebuttonsfield.
-
buttons
public byte buttons(int index) - Returns:
- the value at the specified index of the
buttonsfield.
-
axes
- Returns:
- a
FloatBufferview of theaxesfield.
-
axes
public float axes(int index) - Returns:
- the value at the specified index of the
axesfield.
-
buttons
Copies the specifiedByteBufferto thebuttonsfield. -
buttons
Sets the specified value at the specified index of thebuttonsfield. -
axes
Copies the specifiedFloatBufferto theaxesfield. -
axes
Sets the specified value at the specified index of theaxesfield. -
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 newGLFWGamepadStateinstance allocated withmemAlloc. The instance must be explicitly freed. -
calloc
Returns a newGLFWGamepadStateinstance allocated withmemCalloc. The instance must be explicitly freed. -
create
Returns a newGLFWGamepadStateinstance allocated withBufferUtils. -
create
Returns a newGLFWGamepadStateinstance for the specified memory address. -
createSafe
-
malloc
Returns a newGLFWGamepadState.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
Returns a newGLFWGamepadState.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
Returns a newGLFWGamepadState.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
Create aGLFWGamepadState.Bufferinstance 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 newGLFWGamepadStateinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
Returns a newGLFWGamepadStateinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
malloc
Returns a newGLFWGamepadState.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
capacity- the buffer capacitystack- the stack from which to allocate
-
calloc
Returns a newGLFWGamepadState.Bufferinstance allocated on the specifiedMemoryStackand 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.
-