Top Description Inners Fields Constructors Methods
org.lwjgl.openvr

public Class VRControllerState

extends Struct<VRControllerState>
implements NativeResource
Class Inheritance
All Implemented Interfaces
org.lwjgl.system.NativeResource, java.lang.AutoCloseable
Annotations
@NativeType:struct VRControllerState_t
Imports
javax.annotation.*, java.nio.*, org.lwjgl.*, org.lwjgl.system.*

Holds all the state of a controller at one moment in time.

Layout


struct VRControllerState_t {
    uint32_t unPacketNum;
    uint64_t ulButtonPressed;
    uint64_t ulButtonTouched;
    VRControllerAxis_t rAxis[5];
}

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
public static final int
ALIGNOF

The struct alignment in bytes.

public static final int
RAXIS

The struct member offsets.

public static final int
SIZEOF

The struct size in bytes.

public static final int
ULBUTTONPRESSED

The struct member offsets.

public static final int
ULBUTTONTOUCHED

The struct member offsets.

public static final int
UNPACKETNUM

The struct member offsets.

Inherited from org.lwjgl.system.Struct:
containerDEFAULT_ALIGN_ASDEFAULT_PACK_ALIGNMENT

Constructor Summary

AccessConstructor and Description
protected
VRControllerState(long address, ByteBuffer container)

public
VRControllerState(ByteBuffer container)

Creates a VRControllerState instance at the current position of the specified ByteBuffer container.

Method Summary

Modifier and TypeMethod and Description
public static VRControllerState
calloc()

Returns a new VRControllerState instance allocated with memCalloc.

public static VRControllerState.Buffer
calloc(int
the buffer capacity
capacity
)

Returns a new VRControllerState.Buffer instance allocated with memCalloc.

public static VRControllerState
calloc(MemoryStack
the stack from which to allocate
stack
)

Returns a new VRControllerState instance allocated on the specified MemoryStack and initializes all its bits to zero.

public static VRControllerState.Buffer
calloc(int
the buffer capacity
capacity
,
MemoryStack
the stack from which to allocate
stack
)

Returns a new VRControllerState.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.

public static VRControllerState
callocStack()

Deprecated
Deprecated for removal in 3.4.0.
public static VRControllerState
callocStack(MemoryStack stack)

Deprecated
Deprecated for removal in 3.4.0.
public static VRControllerState.Buffer
callocStack(int capacity)

Deprecated
Deprecated for removal in 3.4.0.
public static VRControllerState.Buffer
callocStack(int capacity, MemoryStack stack)

Deprecated
Deprecated for removal in 3.4.0.
protected VRControllerState
create(long
the struct memory address
address
,
ByteBuffer
an optional container buffer, to be referenced strongly by the struct instance.
container
)

Implements abstract org.lwjgl.system.Struct.create.

Similar to the constructor, but returns the exact type of the Struct subclass.
public static VRControllerState
create()

Returns a new VRControllerState instance allocated with BufferUtils.

public static VRControllerState
create(long address)

Returns a new VRControllerState instance for the specified memory address.

public static VRControllerState.Buffer
create(int
the buffer capacity
capacity
)

Returns a new VRControllerState.Buffer instance allocated with BufferUtils.

public static VRControllerState.Buffer
create(long
the memory address
address
,
int
the buffer capacity
capacity
)

Create a VRControllerState.Buffer instance at the specified memory.

public static VRControllerState
createSafe(long address)

Like create, but returns null if address is NULL.

public static VRControllerState.Buffer
createSafe(long address, int capacity)

Like create, but returns null if address is NULL.

public static VRControllerState
malloc()

Returns a new VRControllerState instance allocated with memAlloc.

public static VRControllerState.Buffer
malloc(int
the buffer capacity
capacity
)

Returns a new VRControllerState.Buffer instance allocated with memAlloc.

public static VRControllerState
malloc(MemoryStack
the stack from which to allocate
stack
)

Returns a new VRControllerState instance allocated on the specified MemoryStack.

public static VRControllerState.Buffer
malloc(int
the buffer capacity
capacity
,
MemoryStack
the stack from which to allocate
stack
)

Returns a new VRControllerState.Buffer instance allocated on the specified MemoryStack.

public static VRControllerState
mallocStack()

Deprecated
Deprecated for removal in 3.4.0.
public static VRControllerState
mallocStack(MemoryStack stack)

Deprecated
Deprecated for removal in 3.4.0.
public static VRControllerState.Buffer
mallocStack(int capacity)

Deprecated
Deprecated for removal in 3.4.0.
public static VRControllerState.Buffer
mallocStack(int capacity, MemoryStack stack)

Deprecated
Deprecated for removal in 3.4.0.
public static VRControllerAxis.Buffer
nrAxis(long struct)

Unsafe version of rAxis.

public static VRControllerAxis
nrAxis(long struct, int index)

Unsafe version of rAxis.

public static void
nrAxis(long struct, VRControllerAxis.Buffer value)

Unsafe version of rAxis.

public static void
nrAxis(long struct, int index, VRControllerAxis value)

Unsafe version of rAxis.

public static long
nulButtonPressed(long struct)

Unsafe version of ulButtonPressed.

public static void
nulButtonPressed(long struct, long value)

Unsafe version of ulButtonPressed.

public static long
nulButtonTouched(long struct)

Unsafe version of ulButtonTouched.

public static void
nulButtonTouched(long struct, long value)

Unsafe version of ulButtonTouched.

public static int
nunPacketNum(long struct)

Unsafe version of unPacketNum.

public static void
nunPacketNum(long struct, int value)

Unsafe version of unPacketNum.

public VRControllerAxis.Buffer
rAxis()

axis data for the controller's analog inputs

public VRControllerAxis
rAxis(int index)

axis data for the controller's analog inputs

public VRControllerState
rAxis(VRControllerAxis.Buffer value)

Copies the specified VRControllerAxis.Buffer to the rAxis field.

public VRControllerState
rAxis(int index, VRControllerAxis value)

Copies the specified VRControllerAxis at the specified index of the rAxis field.

public VRControllerState
rAxis(Consumer<VRControllerAxis.Buffer> consumer)

Passes the rAxis field to the specified Consumer.

public VRControllerState
rAxis(int index, Consumer<VRControllerAxis> consumer)

Passes the element at index of the rAxis field to the specified Consumer.

public VRControllerState
set(int unPacketNum, long ulButtonPressed, long ulButtonTouched, VRControllerAxis.Buffer rAxis)

Initializes this struct with the specified values.

public VRControllerState

Returns:

this struct
set
(VRControllerState
the source struct
src
)

Copies the specified struct data to this struct.

public int
sizeof()

Implements abstract org.lwjgl.system.Struct.sizeof.

Returns sizeof(struct).
public long
ulButtonPressed()

bit flags for each of the buttons.

public VRControllerState
ulButtonPressed(long value)

Sets the specified value to the ulButtonPressed field.

public long

Returns:

the value of the ulButtonTouched field.
ulButtonTouched
()

public VRControllerState
ulButtonTouched(long value)

Sets the specified value to the ulButtonTouched field.

public int
unPacketNum()

If packet num matches that on your prior call, then the controller state hasn't been changed since your last call and there is no need to process it.

public VRControllerState
unPacketNum(int value)

Sets the specified value to the unPacketNum field.

Inherited from org.lwjgl.system.Struct:
__array__array__array__checkContainer__checkMalloc__create__getContainer__getContainer__member__member__member__padding__padding__struct__struct__union__unionclearfreeisNullvalidate

Field Detail

ALIGNOFback to summary
public static final int ALIGNOF

The struct alignment in bytes.

RAXISback to summary
public static final int RAXIS

The struct member offsets.

SIZEOFback to summary
public static final int SIZEOF

The struct size in bytes.

ULBUTTONPRESSEDback to summary
public static final int ULBUTTONPRESSED

The struct member offsets.

ULBUTTONTOUCHEDback to summary
public static final int ULBUTTONTOUCHED

The struct member offsets.

UNPACKETNUMback to summary
public static final int UNPACKETNUM

The struct member offsets.

Constructor Detail

VRControllerStateback to summary
protected VRControllerState(long address, ByteBuffer container)
VRControllerStateback to summary
public VRControllerState(ByteBuffer container)

Creates a VRControllerState 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.

Method Detail

callocback to summary
public static VRControllerState calloc()

Returns a new VRControllerState instance allocated with memCalloc. The instance must be explicitly freed.

callocback to summary
public static VRControllerState.Buffer calloc(int capacity)

Returns a new VRControllerState.Buffer instance allocated with memCalloc. The instance must be explicitly freed.

Parameters
capacity:int

the buffer capacity

callocback to summary
public static VRControllerState calloc(MemoryStack stack)

Returns a new VRControllerState instance allocated on the specified MemoryStack and initializes all its bits to zero.

Parameters
stack:MemoryStack

the stack from which to allocate

callocback to summary
public static VRControllerState.Buffer calloc(int capacity, MemoryStack stack)

Returns a new VRControllerState.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.

Parameters
capacity:int

the buffer capacity

stack:MemoryStack

the stack from which to allocate

callocStackback to summary
public static VRControllerState callocStack()

Deprecated

Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.

Annotations
@Deprecated
callocStackback to summary
public static VRControllerState callocStack(MemoryStack stack)

Deprecated

Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.

Annotations
@Deprecated
callocStackback to summary
public static VRControllerState.Buffer callocStack(int capacity)

Deprecated

Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.

Annotations
@Deprecated
callocStackback to summary
public static VRControllerState.Buffer callocStack(int capacity, MemoryStack stack)

Deprecated

Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.

Annotations
@Deprecated
createback to summary
protected VRControllerState create(long address, ByteBuffer container)

Implements abstract org.lwjgl.system.Struct.create.

Doc from org.lwjgl.system.Struct.create.

Similar to the constructor, but returns the exact type of the Struct subclass.

Effectively, every Struct instance is a factory for more instances of the same type. This is used by StructBuffer.

Parameters
address:long

the struct memory address

container:ByteBuffer

an optional container buffer, to be referenced strongly by the struct instance.

Annotations
@Override
createback to summary
public static VRControllerState create()

Returns a new VRControllerState instance allocated with BufferUtils.

createback to summary
public static VRControllerState create(long address)

Returns a new VRControllerState instance for the specified memory address.

createback to summary
public static VRControllerState.Buffer create(int capacity)

Returns a new VRControllerState.Buffer instance allocated with BufferUtils.

Parameters
capacity:int

the buffer capacity

createback to summary
public static VRControllerState.Buffer create(long address, int capacity)

Create a VRControllerState.Buffer instance at the specified memory.

Parameters
address:long

the memory address

capacity:int

the buffer capacity

createSafeback to summary
public static VRControllerState createSafe(long address)

Like create, but returns null if address is NULL.

Annotations
@Nullable
createSafeback to summary
public static VRControllerState.Buffer createSafe(long address, int capacity)

Like create, but returns null if address is NULL.

Annotations
@Nullable
mallocback to summary
public static VRControllerState malloc()

Returns a new VRControllerState instance allocated with memAlloc. The instance must be explicitly freed.

mallocback to summary
public static VRControllerState.Buffer malloc(int capacity)

Returns a new VRControllerState.Buffer instance allocated with memAlloc. The instance must be explicitly freed.

Parameters
capacity:int

the buffer capacity

mallocback to summary
public static VRControllerState malloc(MemoryStack stack)

Returns a new VRControllerState instance allocated on the specified MemoryStack.

Parameters
stack:MemoryStack

the stack from which to allocate

mallocback to summary
public static VRControllerState.Buffer malloc(int capacity, MemoryStack stack)

Returns a new VRControllerState.Buffer instance allocated on the specified MemoryStack.

Parameters
capacity:int

the buffer capacity

stack:MemoryStack

the stack from which to allocate

mallocStackback to summary
public static VRControllerState mallocStack()

Deprecated

Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.

Annotations
@Deprecated
mallocStackback to summary
public static VRControllerState mallocStack(MemoryStack stack)

Deprecated

Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.

Annotations
@Deprecated
mallocStackback to summary
public static VRControllerState.Buffer mallocStack(int capacity)

Deprecated

Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.

Annotations
@Deprecated
mallocStackback to summary
public static VRControllerState.Buffer mallocStack(int capacity, MemoryStack stack)

Deprecated

Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.

Annotations
@Deprecated
nrAxisback to summary
public static VRControllerAxis.Buffer nrAxis(long struct)

Unsafe version of rAxis.

nrAxisback to summary
public static VRControllerAxis nrAxis(long struct, int index)

Unsafe version of rAxis.

nrAxisback to summary
public static void nrAxis(long struct, VRControllerAxis.Buffer value)

Unsafe version of rAxis.

nrAxisback to summary
public static void nrAxis(long struct, int index, VRControllerAxis value)

Unsafe version of rAxis.

nulButtonPressedback to summary
public static long nulButtonPressed(long struct)

Unsafe version of ulButtonPressed.

nulButtonPressedback to summary
public static void nulButtonPressed(long struct, long value)

Unsafe version of ulButtonPressed.

nulButtonTouchedback to summary
public static long nulButtonTouched(long struct)

Unsafe version of ulButtonTouched.

nulButtonTouchedback to summary
public static void nulButtonTouched(long struct, long value)

Unsafe version of ulButtonTouched.

nunPacketNumback to summary
public static int nunPacketNum(long struct)

Unsafe version of unPacketNum.

nunPacketNumback to summary
public static void nunPacketNum(long struct, int value)

Unsafe version of unPacketNum.

rAxisback to summary
public VRControllerAxis.Buffer rAxis()

axis data for the controller's analog inputs

Annotations
@NativeType:VRControllerAxis_t[5]
rAxisback to summary
public VRControllerAxis rAxis(int index)

axis data for the controller's analog inputs

Annotations
@NativeType:VRControllerAxis_t
rAxisback to summary
public VRControllerState rAxis(VRControllerAxis.Buffer value)

Copies the specified VRControllerAxis.Buffer to the rAxis field.

rAxisback to summary
public VRControllerState rAxis(int index, VRControllerAxis value)

Copies the specified VRControllerAxis at the specified index of the rAxis field.

rAxisback to summary
public VRControllerState rAxis(Consumer<VRControllerAxis.Buffer> consumer)

Passes the rAxis field to the specified Consumer.

rAxisback to summary
public VRControllerState rAxis(int index, Consumer<VRControllerAxis> consumer)

Passes the element at index of the rAxis field to the specified Consumer.

setback to summary
public VRControllerState set(int unPacketNum, long ulButtonPressed, long ulButtonTouched, VRControllerAxis.Buffer rAxis)

Initializes this struct with the specified values.

setback to summary
public VRControllerState set(VRControllerState src)

Copies the specified struct data to this struct.

Parameters
src:VRControllerState

the source struct

Returns:VRControllerState

this struct

sizeofback to summary
public int sizeof()

Implements abstract org.lwjgl.system.Struct.sizeof.

Doc from org.lwjgl.system.Struct.sizeof.

Returns sizeof(struct).

Annotations
@Override
ulButtonPressedback to summary
public long ulButtonPressed()

bit flags for each of the buttons. Use ButtonMaskFromId to turn an ID into a mask

Annotations
@NativeType:uint64_t
ulButtonPressedback to summary
public VRControllerState ulButtonPressed(long value)

Sets the specified value to the ulButtonPressed field.

ulButtonTouchedback to summary
public long ulButtonTouched()
Returns:long

the value of the ulButtonTouched field.

Annotations
@NativeType:uint64_t
ulButtonTouchedback to summary
public VRControllerState ulButtonTouched(long value)

Sets the specified value to the ulButtonTouched field.

unPacketNumback to summary
public int unPacketNum()

If packet num matches that on your prior call, then the controller state hasn't been changed since your last call and there is no need to process it.

Annotations
@NativeType:uint32_t
unPacketNumback to summary
public VRControllerState unPacketNum(int value)

Sets the specified value to the unPacketNum field.

org.lwjgl.openvr back to summary

public Class VRControllerState.Buffer

extends StructBuffer<VRControllerState, VRControllerState.Buffer>
implements NativeResource
Class Inheritance
All Implemented Interfaces
org.lwjgl.system.NativeResource, java.lang.AutoCloseable

An array of VRControllerState structs.

Field Summary

Modifier and TypeField and Description
private static final VRControllerState

Constructor Summary

AccessConstructor and Description
public
Buffer(ByteBuffer container)

Creates a new VRControllerState.Buffer instance backed by the specified container.

public
Buffer(long address, int cap)

pack-priv
Buffer(long address, ByteBuffer container, int mark, int pos, int lim, int cap)

Method Summary

Modifier and TypeMethod and Description
protected VRControllerState
public VRControllerAxis.Buffer

Returns:

a VRControllerAxis.Buffer view of the VRControllerState#rAxis field.
rAxis
()

public VRControllerAxis

Returns:

a VRControllerAxis view of the struct at the specified index of the VRControllerState#rAxis field.
rAxis
(int index)

public VRControllerState.Buffer
public VRControllerState.Buffer
rAxis(int index, VRControllerAxis value)

Copies the specified VRControllerAxis at the specified index of the VRControllerState#rAxis field.

public VRControllerState.Buffer
rAxis(Consumer<VRControllerAxis.Buffer> consumer)

Passes the VRControllerState#rAxis field to the specified Consumer.

public VRControllerState.Buffer
rAxis(int index, Consumer<VRControllerAxis> consumer)

Passes the element at index of the VRControllerState#rAxis field to the specified Consumer.

protected VRControllerState.Buffer
public long

Returns:

the value of the VRControllerState#ulButtonPressed field.
ulButtonPressed
()

public VRControllerState.Buffer
ulButtonPressed(long value)

Sets the specified value to the VRControllerState#ulButtonPressed field.

public long

Returns:

the value of the ulButtonTouched field.
ulButtonTouched
()

public VRControllerState.Buffer
ulButtonTouched(long value)

Sets the specified value to the ulButtonTouched field.

public int

Returns:

the value of the VRControllerState#unPacketNum field.
unPacketNum
()

public VRControllerState.Buffer
unPacketNum(int value)

Sets the specified value to the VRControllerState#unPacketNum field.

Inherited from org.lwjgl.system.StructBuffer:
applyapplyforEachgetgetgetgetiteratorparallelStreamputputsizeofspliteratorstream

Field Detail

ELEMENT_FACTORYback to summary
private static final VRControllerState ELEMENT_FACTORY

Constructor Detail

Bufferback to summary
public Buffer(ByteBuffer container)

Creates a new VRControllerState.Buffer instance backed by the specified container.

Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided by VRControllerState#SIZEOF, and its mark will be undefined.

The created buffer instance holds a strong reference to the container object.

Bufferback to summary
public Buffer(long address, int cap)
Bufferback to summary
pack-priv Buffer(long address, ByteBuffer container, int mark, int pos, int lim, int cap)

Method Detail

getElementFactoryback to summary
protected VRControllerState getElementFactory()

Implements abstract org.lwjgl.system.StructBuffer.getElementFactory.

Annotations
@Override
rAxisback to summary
public VRControllerAxis.Buffer rAxis()
Returns:VRControllerAxis.Buffer

a VRControllerAxis.Buffer view of the VRControllerState#rAxis field.

Annotations
@NativeType:VRControllerAxis_t[5]
rAxisback to summary
public VRControllerAxis rAxis(int index)
Returns:VRControllerAxis

a VRControllerAxis view of the struct at the specified index of the VRControllerState#rAxis field.

Annotations
@NativeType:VRControllerAxis_t
rAxisback to summary
public VRControllerState.Buffer rAxis(VRControllerAxis.Buffer value)

Copies the specified VRControllerAxis.Buffer to the VRControllerState#rAxis field.

rAxisback to summary
public VRControllerState.Buffer rAxis(int index, VRControllerAxis value)

Copies the specified VRControllerAxis at the specified index of the VRControllerState#rAxis field.

rAxisback to summary
public VRControllerState.Buffer rAxis(Consumer<VRControllerAxis.Buffer> consumer)

Passes the VRControllerState#rAxis field to the specified Consumer.

rAxisback to summary
public VRControllerState.Buffer rAxis(int index, Consumer<VRControllerAxis> consumer)

Passes the element at index of the VRControllerState#rAxis field to the specified Consumer.

selfback to summary
protected VRControllerState.Buffer self()

Implements abstract org.lwjgl.system.CustomBuffer.self.

Annotations
@Override
ulButtonPressedback to summary
public long ulButtonPressed()
Returns:long

the value of the VRControllerState#ulButtonPressed field.

Annotations
@NativeType:uint64_t
ulButtonPressedback to summary
public VRControllerState.Buffer ulButtonPressed(long value)

Sets the specified value to the VRControllerState#ulButtonPressed field.

ulButtonTouchedback to summary
public long ulButtonTouched()
Returns:long

the value of the ulButtonTouched field.

Annotations
@NativeType:uint64_t
ulButtonTouchedback to summary
public VRControllerState.Buffer ulButtonTouched(long value)

Sets the specified value to the ulButtonTouched field.

unPacketNumback to summary
public int unPacketNum()
Returns:int

the value of the VRControllerState#unPacketNum field.

Annotations
@NativeType:uint32_t
unPacketNumback to summary
public VRControllerState.Buffer unPacketNum(int value)

Sets the specified value to the VRControllerState#unPacketNum field.