Package org.lwjgl.glfw
Class GLFWGamepadState
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.glfw.GLFWGamepadState
-
- All Implemented Interfaces:
java.lang.AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
public class GLFWGamepadState extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResourceDescribes the input state of a gamepad.Layout
struct GLFWgamepadstate { unsigned charbuttons()[15]; floataxes()[6]; }- Since:
- version 3.3
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGLFWGamepadState.BufferAn array ofGLFWGamepadStatestructs.
-
Constructor Summary
Constructors Constructor Description GLFWGamepadState(java.nio.ByteBuffer container)Creates aGLFWGamepadStateinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.nio.FloatBufferaxes()the states of each gamepad axis, in the range -1.0 to 1.0 inclusivefloataxes(int index)the states of each gamepad axis, in the range -1.0 to 1.0 inclusiveGLFWGamepadStateaxes(int index, float value)Sets the specified value at the specified index of theaxes()field.GLFWGamepadStateaxes(java.nio.FloatBuffer value)Copies the specifiedFloatBufferto theaxes()field.java.nio.ByteBufferbuttons()bytebuttons(int index)GLFWGamepadStatebuttons(int index, byte value)Sets the specified value at the specified index of thebuttons()field.GLFWGamepadStatebuttons(java.nio.ByteBuffer value)Copies the specifiedByteBufferto thebuttons()field.static GLFWGamepadStatecalloc()Returns a newGLFWGamepadStateinstance allocated withmemCalloc.static GLFWGamepadState.Buffercalloc(int capacity)Returns a newGLFWGamepadState.Bufferinstance allocated withmemCalloc.static GLFWGamepadState.Buffercalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newGLFWGamepadState.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static GLFWGamepadStatecalloc(org.lwjgl.system.MemoryStack stack)Returns a newGLFWGamepadStateinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static GLFWGamepadStatecallocStack()Deprecated.static GLFWGamepadState.BuffercallocStack(int capacity)Deprecated.static GLFWGamepadState.BuffercallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Deprecated.static GLFWGamepadStatecallocStack(org.lwjgl.system.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 GLFWGamepadStatecreateSafe(long address)static 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, org.lwjgl.system.MemoryStack stack)Returns a newGLFWGamepadState.Bufferinstance allocated on the specifiedMemoryStack.static GLFWGamepadStatemalloc(org.lwjgl.system.MemoryStack stack)Returns a newGLFWGamepadStateinstance allocated on the specifiedMemoryStack.static GLFWGamepadStatemallocStack()Deprecated.static GLFWGamepadState.BuffermallocStack(int capacity)Deprecated.static GLFWGamepadState.BuffermallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Deprecated.static GLFWGamepadStatemallocStack(org.lwjgl.system.MemoryStack stack)Deprecated.static java.nio.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, java.nio.FloatBuffer value)Unsafe version ofaxes.static java.nio.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, java.nio.ByteBuffer value)Unsafe version ofbuttons.GLFWGamepadStateset(java.nio.ByteBuffer buttons, java.nio.FloatBuffer axes)Initializes this struct with the specified values.GLFWGamepadStateset(GLFWGamepadState src)Copies the specified struct data to this struct.intsizeof()
-
-
-
Constructor Detail
-
GLFWGamepadState
public GLFWGamepadState(java.nio.ByteBuffer container)
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 Detail
-
sizeof
public int sizeof()
- Specified by:
sizeofin classorg.lwjgl.system.Struct
-
buttons
public java.nio.ByteBuffer buttons() public byte buttons(int index)
-
axes
public java.nio.FloatBuffer axes() public float axes(int index)
the states of each gamepad axis, in the range -1.0 to 1.0 inclusive
-
buttons
public GLFWGamepadState buttons(java.nio.ByteBuffer value)
Copies the specifiedByteBufferto thebuttons()field.
-
buttons
public GLFWGamepadState buttons(int index, byte value)
Sets the specified value at the specified index of thebuttons()field.
-
axes
public GLFWGamepadState axes(java.nio.FloatBuffer value)
Copies the specifiedFloatBufferto theaxes()field.
-
axes
public GLFWGamepadState axes(int index, float value)
Sets the specified value at the specified index of theaxes()field.
-
set
public GLFWGamepadState set(java.nio.ByteBuffer buttons, java.nio.FloatBuffer axes)
Initializes this struct with the specified values.
-
set
public GLFWGamepadState set(GLFWGamepadState src)
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
public static GLFWGamepadState malloc()
Returns a newGLFWGamepadStateinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static GLFWGamepadState calloc()
Returns a newGLFWGamepadStateinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static GLFWGamepadState create()
Returns a newGLFWGamepadStateinstance allocated withBufferUtils.
-
create
public static GLFWGamepadState create(long address)
Returns a newGLFWGamepadStateinstance for the specified memory address.
-
createSafe
@Nullable public static GLFWGamepadState createSafe(long address)
-
malloc
public static GLFWGamepadState.Buffer malloc(int capacity)
Returns a newGLFWGamepadState.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static GLFWGamepadState.Buffer calloc(int capacity)
Returns a newGLFWGamepadState.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static GLFWGamepadState.Buffer create(int capacity)
Returns a newGLFWGamepadState.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static GLFWGamepadState.Buffer create(long address, int capacity)
Create aGLFWGamepadState.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static GLFWGamepadState.Buffer createSafe(long address, int capacity)
-
mallocStack
@Deprecated public static GLFWGamepadState mallocStack()
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead.
-
callocStack
@Deprecated public static GLFWGamepadState callocStack()
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead.
-
mallocStack
@Deprecated public static GLFWGamepadState mallocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead.
-
callocStack
@Deprecated public static GLFWGamepadState callocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead.
-
mallocStack
@Deprecated public static GLFWGamepadState.Buffer mallocStack(int capacity)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)instead.
-
callocStack
@Deprecated public static GLFWGamepadState.Buffer callocStack(int capacity)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)instead.
-
mallocStack
@Deprecated public static GLFWGamepadState.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)instead.
-
callocStack
@Deprecated public static GLFWGamepadState.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)instead.
-
malloc
public static GLFWGamepadState malloc(org.lwjgl.system.MemoryStack stack)
Returns a newGLFWGamepadStateinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
public static GLFWGamepadState calloc(org.lwjgl.system.MemoryStack stack)
Returns a newGLFWGamepadStateinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
malloc
public static GLFWGamepadState.Buffer malloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newGLFWGamepadState.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
calloc
public static GLFWGamepadState.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newGLFWGamepadState.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
nbuttons
public static java.nio.ByteBuffer nbuttons(long struct)
Unsafe version ofbuttons().
-
nbuttons
public static byte nbuttons(long struct, int index)Unsafe version ofbuttons.
-
naxes
public static java.nio.FloatBuffer naxes(long struct)
Unsafe version ofaxes().
-
naxes
public static float naxes(long struct, int index)Unsafe version ofaxes.
-
nbuttons
public static void nbuttons(long struct, java.nio.ByteBuffer value)Unsafe version ofbuttons.
-
nbuttons
public static void nbuttons(long struct, int index, byte value)Unsafe version ofbuttons.
-
naxes
public static void naxes(long struct, java.nio.FloatBuffer value)Unsafe version ofaxes.
-
naxes
public static void naxes(long struct, int index, float value)Unsafe version ofaxes.
-
-