Package org.lwjgl.ovr
Class OVRHapticsBuffer
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.ovr.OVRHapticsBuffer
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,org.lwjgl.system.NativeResource
,org.lwjgl.system.Pointer
public class OVRHapticsBuffer extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResource
Haptics buffer descriptor, contains amplitude samples used for Touch vibration.Member documentation
Samples
– samples stored in opaque formatSamplesCount
– number of samples (up toOVR.OVR_HAPTICS_BUFFER_SAMPLES_MAX
)SubmitMode
– how samples are submitted to the hardware. Must be:HapticsBufferSubmit_Enqueue
Layout
struct ovrHapticsBuffer { void * Samples; int SamplesCount; ovrHapticsBufferSubmitMode SubmitMode; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
OVRHapticsBuffer.Buffer
An array ofOVRHapticsBuffer
structs.
-
Field Summary
Fields Modifier and Type Field Description static int
ALIGNOF
The struct alignment in bytes.static int
SAMPLES
SAMPLESCOUNTThe struct member offsets.static int
SIZEOF
The struct size in bytes.static int
SUBMITMODE
The struct member offsets.
-
Constructor Summary
Constructors Constructor Description OVRHapticsBuffer(java.nio.ByteBuffer container)
Creates aOVRHapticsBuffer
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static OVRHapticsBuffer
calloc()
Returns a newOVRHapticsBuffer
instance allocated withmemCalloc
.static OVRHapticsBuffer.Buffer
calloc(int capacity)
Returns a newOVRHapticsBuffer.Buffer
instance allocated withmemCalloc
.static OVRHapticsBuffer
callocStack()
Returns a newOVRHapticsBuffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static OVRHapticsBuffer.Buffer
callocStack(int capacity)
Returns a newOVRHapticsBuffer.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static OVRHapticsBuffer.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newOVRHapticsBuffer.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static OVRHapticsBuffer
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newOVRHapticsBuffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static OVRHapticsBuffer
create()
Returns a newOVRHapticsBuffer
instance allocated withBufferUtils
.static OVRHapticsBuffer.Buffer
create(int capacity)
Returns a newOVRHapticsBuffer.Buffer
instance allocated withBufferUtils
.static OVRHapticsBuffer
create(long address)
Returns a newOVRHapticsBuffer
instance for the specified memory address.static OVRHapticsBuffer.Buffer
create(long address, int capacity)
Create aOVRHapticsBuffer.Buffer
instance at the specified memory.static OVRHapticsBuffer
createSafe(long address)
static OVRHapticsBuffer.Buffer
createSafe(long address, int capacity)
static OVRHapticsBuffer
malloc()
Returns a newOVRHapticsBuffer
instance allocated withmemAlloc
.static OVRHapticsBuffer.Buffer
malloc(int capacity)
Returns a newOVRHapticsBuffer.Buffer
instance allocated withmemAlloc
.static OVRHapticsBuffer
mallocStack()
Returns a newOVRHapticsBuffer
instance allocated on the thread-localMemoryStack
.static OVRHapticsBuffer.Buffer
mallocStack(int capacity)
Returns a newOVRHapticsBuffer.Buffer
instance allocated on the thread-localMemoryStack
.static OVRHapticsBuffer.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newOVRHapticsBuffer.Buffer
instance allocated on the specifiedMemoryStack
.static OVRHapticsBuffer
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newOVRHapticsBuffer
instance allocated on the specifiedMemoryStack
.static java.nio.ByteBuffer
nSamples(long struct, int capacity)
Unsafe version ofSamples
.static void
nSamples(long struct, java.nio.ByteBuffer value)
Unsafe version ofSamples
.static int
nSamplesCount(long struct)
Unsafe version ofSamplesCount()
.static void
nSamplesCount(long struct, int value)
Unsafe version ofSamplesCount
.static int
nSubmitMode(long struct)
Unsafe version ofSubmitMode()
.static void
nSubmitMode(long struct, int value)
Unsafe version ofSubmitMode
.java.nio.ByteBuffer
Samples(int capacity)
Returns aByteBuffer
view of the data pointed to by theSamples
field.OVRHapticsBuffer
Samples(java.nio.ByteBuffer value)
Sets the address of the specifiedByteBuffer
to theSamples
field.int
SamplesCount()
Returns the value of theSamplesCount
field.OVRHapticsBuffer
SamplesCount(int value)
Sets the specified value to theSamplesCount
field.OVRHapticsBuffer
set(java.nio.ByteBuffer Samples, int SamplesCount, int SubmitMode)
Initializes this struct with the specified values.OVRHapticsBuffer
set(OVRHapticsBuffer src)
Copies the specified struct data to this struct.int
sizeof()
int
SubmitMode()
Returns the value of theSubmitMode
field.OVRHapticsBuffer
SubmitMode(int value)
Sets the specified value to theSubmitMode
field.static void
validate(long struct)
Validates pointer members that should not beNULL
.static void
validate(long array, int count)
Callsvalidate(long)
for each struct contained in the specified struct array.
-
-
-
Constructor Detail
-
OVRHapticsBuffer
public OVRHapticsBuffer(java.nio.ByteBuffer container)
Creates aOVRHapticsBuffer
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
-
Samples
public java.nio.ByteBuffer Samples(int capacity)
Returns aByteBuffer
view of the data pointed to by theSamples
field.- Parameters:
capacity
- the number of elements in the returned buffer
-
SamplesCount
public int SamplesCount()
Returns the value of theSamplesCount
field.
-
SubmitMode
public int SubmitMode()
Returns the value of theSubmitMode
field.
-
Samples
public OVRHapticsBuffer Samples(java.nio.ByteBuffer value)
Sets the address of the specifiedByteBuffer
to theSamples
field.
-
SamplesCount
public OVRHapticsBuffer SamplesCount(int value)
Sets the specified value to theSamplesCount
field.
-
SubmitMode
public OVRHapticsBuffer SubmitMode(int value)
Sets the specified value to theSubmitMode
field.
-
set
public OVRHapticsBuffer set(java.nio.ByteBuffer Samples, int SamplesCount, int SubmitMode)
Initializes this struct with the specified values.
-
set
public OVRHapticsBuffer set(OVRHapticsBuffer src)
Copies the specified struct data to this struct.- Parameters:
src
- the source struct- Returns:
- this struct
-
malloc
public static OVRHapticsBuffer malloc()
Returns a newOVRHapticsBuffer
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static OVRHapticsBuffer calloc()
Returns a newOVRHapticsBuffer
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static OVRHapticsBuffer create()
Returns a newOVRHapticsBuffer
instance allocated withBufferUtils
.
-
create
public static OVRHapticsBuffer create(long address)
Returns a newOVRHapticsBuffer
instance for the specified memory address.
-
createSafe
@Nullable public static OVRHapticsBuffer createSafe(long address)
-
malloc
public static OVRHapticsBuffer.Buffer malloc(int capacity)
Returns a newOVRHapticsBuffer.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static OVRHapticsBuffer.Buffer calloc(int capacity)
Returns a newOVRHapticsBuffer.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static OVRHapticsBuffer.Buffer create(int capacity)
Returns a newOVRHapticsBuffer.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static OVRHapticsBuffer.Buffer create(long address, int capacity)
Create aOVRHapticsBuffer.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
@Nullable public static OVRHapticsBuffer.Buffer createSafe(long address, int capacity)
-
mallocStack
public static OVRHapticsBuffer mallocStack()
Returns a newOVRHapticsBuffer
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static OVRHapticsBuffer callocStack()
Returns a newOVRHapticsBuffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static OVRHapticsBuffer mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newOVRHapticsBuffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static OVRHapticsBuffer callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newOVRHapticsBuffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
mallocStack
public static OVRHapticsBuffer.Buffer mallocStack(int capacity)
Returns a newOVRHapticsBuffer.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static OVRHapticsBuffer.Buffer callocStack(int capacity)
Returns a newOVRHapticsBuffer.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacity
-
mallocStack
public static OVRHapticsBuffer.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newOVRHapticsBuffer.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
callocStack
public static OVRHapticsBuffer.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newOVRHapticsBuffer.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
nSamples
public static java.nio.ByteBuffer nSamples(long struct, int capacity)
Unsafe version ofSamples
.
-
nSamplesCount
public static int nSamplesCount(long struct)
Unsafe version ofSamplesCount()
.
-
nSubmitMode
public static int nSubmitMode(long struct)
Unsafe version ofSubmitMode()
.
-
nSamples
public static void nSamples(long struct, java.nio.ByteBuffer value)
Unsafe version ofSamples
.
-
nSamplesCount
public static void nSamplesCount(long struct, int value)
Unsafe version ofSamplesCount
.
-
nSubmitMode
public static void nSubmitMode(long struct, int value)
Unsafe version ofSubmitMode
.
-
validate
public static void validate(long struct)
Validates pointer members that should not beNULL
.- Parameters:
struct
- the struct to validate
-
validate
public static void validate(long array, int count)
Callsvalidate(long)
for each struct contained in the specified struct array.- Parameters:
array
- the struct array to validatecount
- the number of structs inarray
-
-