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.NativeResourceHaptics 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 classOVRHapticsBuffer.BufferAn array ofOVRHapticsBufferstructs.
-
Field Summary
Fields Modifier and Type Field Description static intALIGNOFThe struct alignment in bytes.static intSAMPLES
SAMPLESCOUNTThe struct member offsets.static intSIZEOFThe struct size in bytes.static intSUBMITMODEThe struct member offsets.
-
Constructor Summary
Constructors Constructor Description OVRHapticsBuffer(java.nio.ByteBuffer container)Creates aOVRHapticsBufferinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static OVRHapticsBuffercalloc()Returns a newOVRHapticsBufferinstance allocated withmemCalloc.static OVRHapticsBuffer.Buffercalloc(int capacity)Returns a newOVRHapticsBuffer.Bufferinstance allocated withmemCalloc.static OVRHapticsBuffercallocStack()Returns a newOVRHapticsBufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static OVRHapticsBuffer.BuffercallocStack(int capacity)Returns a newOVRHapticsBuffer.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static OVRHapticsBuffer.BuffercallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newOVRHapticsBuffer.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static OVRHapticsBuffercallocStack(org.lwjgl.system.MemoryStack stack)Returns a newOVRHapticsBufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static OVRHapticsBuffercreate()Returns a newOVRHapticsBufferinstance allocated withBufferUtils.static OVRHapticsBuffer.Buffercreate(int capacity)Returns a newOVRHapticsBuffer.Bufferinstance allocated withBufferUtils.static OVRHapticsBuffercreate(long address)Returns a newOVRHapticsBufferinstance for the specified memory address.static OVRHapticsBuffer.Buffercreate(long address, int capacity)Create aOVRHapticsBuffer.Bufferinstance at the specified memory.static OVRHapticsBuffercreateSafe(long address)static OVRHapticsBuffer.BuffercreateSafe(long address, int capacity)static OVRHapticsBuffermalloc()Returns a newOVRHapticsBufferinstance allocated withmemAlloc.static OVRHapticsBuffer.Buffermalloc(int capacity)Returns a newOVRHapticsBuffer.Bufferinstance allocated withmemAlloc.static OVRHapticsBuffermallocStack()Returns a newOVRHapticsBufferinstance allocated on the thread-localMemoryStack.static OVRHapticsBuffer.BuffermallocStack(int capacity)Returns a newOVRHapticsBuffer.Bufferinstance allocated on the thread-localMemoryStack.static OVRHapticsBuffer.BuffermallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newOVRHapticsBuffer.Bufferinstance allocated on the specifiedMemoryStack.static OVRHapticsBuffermallocStack(org.lwjgl.system.MemoryStack stack)Returns a newOVRHapticsBufferinstance allocated on the specifiedMemoryStack.static java.nio.ByteBuffernSamples(long struct, int capacity)Unsafe version ofSamples.static voidnSamples(long struct, java.nio.ByteBuffer value)Unsafe version ofSamples.static intnSamplesCount(long struct)Unsafe version ofSamplesCount().static voidnSamplesCount(long struct, int value)Unsafe version ofSamplesCount.static intnSubmitMode(long struct)Unsafe version ofSubmitMode().static voidnSubmitMode(long struct, int value)Unsafe version ofSubmitMode.java.nio.ByteBufferSamples(int capacity)Returns aByteBufferview of the data pointed to by theSamplesfield.OVRHapticsBufferSamples(java.nio.ByteBuffer value)Sets the address of the specifiedByteBufferto theSamplesfield.intSamplesCount()Returns the value of theSamplesCountfield.OVRHapticsBufferSamplesCount(int value)Sets the specified value to theSamplesCountfield.OVRHapticsBufferset(java.nio.ByteBuffer Samples, int SamplesCount, int SubmitMode)Initializes this struct with the specified values.OVRHapticsBufferset(OVRHapticsBuffer src)Copies the specified struct data to this struct.intsizeof()intSubmitMode()Returns the value of theSubmitModefield.OVRHapticsBufferSubmitMode(int value)Sets the specified value to theSubmitModefield.static voidvalidate(long struct)Validates pointer members that should not beNULL.static voidvalidate(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 aOVRHapticsBufferinstance 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
-
Samples
public java.nio.ByteBuffer Samples(int capacity)
Returns aByteBufferview of the data pointed to by theSamplesfield.- Parameters:
capacity- the number of elements in the returned buffer
-
SamplesCount
public int SamplesCount()
Returns the value of theSamplesCountfield.
-
SubmitMode
public int SubmitMode()
Returns the value of theSubmitModefield.
-
Samples
public OVRHapticsBuffer Samples(java.nio.ByteBuffer value)
Sets the address of the specifiedByteBufferto theSamplesfield.
-
SamplesCount
public OVRHapticsBuffer SamplesCount(int value)
Sets the specified value to theSamplesCountfield.
-
SubmitMode
public OVRHapticsBuffer SubmitMode(int value)
Sets the specified value to theSubmitModefield.
-
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 newOVRHapticsBufferinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static OVRHapticsBuffer calloc()
Returns a newOVRHapticsBufferinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static OVRHapticsBuffer create()
Returns a newOVRHapticsBufferinstance allocated withBufferUtils.
-
create
public static OVRHapticsBuffer create(long address)
Returns a newOVRHapticsBufferinstance for the specified memory address.
-
createSafe
@Nullable public static OVRHapticsBuffer createSafe(long address)
-
malloc
public static OVRHapticsBuffer.Buffer malloc(int capacity)
Returns a newOVRHapticsBuffer.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static OVRHapticsBuffer.Buffer calloc(int capacity)
Returns a newOVRHapticsBuffer.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static OVRHapticsBuffer.Buffer create(int capacity)
Returns a newOVRHapticsBuffer.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static OVRHapticsBuffer.Buffer create(long address, int capacity)
Create aOVRHapticsBuffer.Bufferinstance 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 newOVRHapticsBufferinstance allocated on the thread-localMemoryStack.
-
callocStack
public static OVRHapticsBuffer callocStack()
Returns a newOVRHapticsBufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.
-
mallocStack
public static OVRHapticsBuffer mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newOVRHapticsBufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
callocStack
public static OVRHapticsBuffer callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newOVRHapticsBufferinstance allocated on the specifiedMemoryStackand 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.Bufferinstance allocated on the thread-localMemoryStack.- Parameters:
capacity- the buffer capacity
-
callocStack
public static OVRHapticsBuffer.Buffer callocStack(int capacity)
Returns a newOVRHapticsBuffer.Bufferinstance allocated on the thread-localMemoryStackand 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.Bufferinstance 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.Bufferinstance allocated on the specifiedMemoryStackand 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
-
-