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.NativeResource
Describes the input state of a gamepad.Layout
struct GLFWgamepadstate { unsigned char
buttons()
[15]; floataxes()
[6]; }- Since:
- version 3.3
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
GLFWGamepadState.Buffer
An array ofGLFWGamepadState
structs.
-
Constructor Summary
Constructors Constructor Description GLFWGamepadState(java.nio.ByteBuffer container)
Creates aGLFWGamepadState
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.nio.FloatBuffer
axes()
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 inclusiveGLFWGamepadState
axes(int index, float value)
Sets the specified value at the specified index of theaxes()
field.GLFWGamepadState
axes(java.nio.FloatBuffer value)
Copies the specifiedFloatBuffer
to theaxes()
field.java.nio.ByteBuffer
buttons()
byte
buttons(int index)
GLFWGamepadState
buttons(int index, byte value)
Sets the specified value at the specified index of thebuttons()
field.GLFWGamepadState
buttons(java.nio.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, org.lwjgl.system.MemoryStack stack)
Returns a newGLFWGamepadState.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static GLFWGamepadState
calloc(org.lwjgl.system.MemoryStack stack)
Returns a newGLFWGamepadState
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static GLFWGamepadState
callocStack()
Deprecated.static GLFWGamepadState.Buffer
callocStack(int capacity)
Deprecated.static GLFWGamepadState.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Deprecated.static GLFWGamepadState
callocStack(org.lwjgl.system.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, org.lwjgl.system.MemoryStack stack)
Returns a newGLFWGamepadState.Buffer
instance allocated on the specifiedMemoryStack
.static GLFWGamepadState
malloc(org.lwjgl.system.MemoryStack stack)
Returns a newGLFWGamepadState
instance allocated on the specifiedMemoryStack
.static GLFWGamepadState
mallocStack()
Deprecated.static GLFWGamepadState.Buffer
mallocStack(int capacity)
Deprecated.static GLFWGamepadState.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Deprecated.static GLFWGamepadState
mallocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.static java.nio.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, java.nio.FloatBuffer value)
Unsafe version ofaxes
.static java.nio.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, java.nio.ByteBuffer value)
Unsafe version ofbuttons
.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()
-
-
-
Constructor Detail
-
GLFWGamepadState
public GLFWGamepadState(java.nio.ByteBuffer container)
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 Detail
-
sizeof
public int sizeof()
- Specified by:
sizeof
in 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 specifiedByteBuffer
to 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 specifiedFloatBuffer
to 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 newGLFWGamepadState
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static GLFWGamepadState calloc()
Returns a newGLFWGamepadState
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static GLFWGamepadState create()
Returns a newGLFWGamepadState
instance allocated withBufferUtils
.
-
create
public static GLFWGamepadState create(long address)
Returns a newGLFWGamepadState
instance for the specified memory address.
-
createSafe
@Nullable public static GLFWGamepadState createSafe(long address)
-
malloc
public static GLFWGamepadState.Buffer malloc(int capacity)
Returns a newGLFWGamepadState.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static GLFWGamepadState.Buffer calloc(int capacity)
Returns a newGLFWGamepadState.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static GLFWGamepadState.Buffer create(int capacity)
Returns a newGLFWGamepadState.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static GLFWGamepadState.Buffer create(long address, int capacity)
Create aGLFWGamepadState.Buffer
instance 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 newGLFWGamepadState
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
calloc
public static GLFWGamepadState calloc(org.lwjgl.system.MemoryStack stack)
Returns a newGLFWGamepadState
instance allocated on the specifiedMemoryStack
and 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.Buffer
instance 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.Buffer
instance allocated on the specifiedMemoryStack
and 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
.
-
-