Package org.lwjgl.bgfx
Class BGFXVertexLayout
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.bgfx.BGFXVertexLayout
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,org.lwjgl.system.NativeResource
,org.lwjgl.system.Pointer
public class BGFXVertexLayout extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResource
Vertex layout.Member documentation
stride
– vertex strideoffset[BGFX_ATTRIB_COUNT]
– relative attribute offset from the vertex
Layout
struct bgfx_vertex_layout_t { uint32_t hash; uint16_t stride; uint16_t offset[BGFX_ATTRIB_COUNT]; uint16_t attributes[BGFX_ATTRIB_COUNT]; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BGFXVertexLayout.Buffer
An array ofBGFXVertexLayout
structs.
-
Constructor Summary
Constructors Constructor Description BGFXVertexLayout(java.nio.ByteBuffer container)
Creates aBGFXVertexLayout
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.nio.ShortBuffer
attributes()
Returns aShortBuffer
view of theattributes
field.short
attributes(int index)
Returns the value at the specified index of theattributes
field.BGFXVertexLayout
attributes(int index, short value)
Sets the specified value at the specified index of theattributes
field.BGFXVertexLayout
attributes(java.nio.ShortBuffer value)
Copies the specifiedShortBuffer
to theattributes
field.static BGFXVertexLayout
calloc()
Returns a newBGFXVertexLayout
instance allocated withmemCalloc
.static BGFXVertexLayout.Buffer
calloc(int capacity)
Returns a newBGFXVertexLayout.Buffer
instance allocated withmemCalloc
.static BGFXVertexLayout
callocStack()
Returns a newBGFXVertexLayout
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static BGFXVertexLayout.Buffer
callocStack(int capacity)
Returns a newBGFXVertexLayout.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static BGFXVertexLayout.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newBGFXVertexLayout.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static BGFXVertexLayout
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newBGFXVertexLayout
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static BGFXVertexLayout
create()
Returns a newBGFXVertexLayout
instance allocated withBufferUtils
.static BGFXVertexLayout.Buffer
create(int capacity)
Returns a newBGFXVertexLayout.Buffer
instance allocated withBufferUtils
.static BGFXVertexLayout
create(long address)
Returns a newBGFXVertexLayout
instance for the specified memory address.static BGFXVertexLayout.Buffer
create(long address, int capacity)
Create aBGFXVertexLayout.Buffer
instance at the specified memory.static BGFXVertexLayout
createSafe(long address)
static BGFXVertexLayout.Buffer
createSafe(long address, int capacity)
int
hash()
Returns the value of thehash
field.BGFXVertexLayout
hash(int value)
Sets the specified value to thehash
field.static BGFXVertexLayout
malloc()
Returns a newBGFXVertexLayout
instance allocated withmemAlloc
.static BGFXVertexLayout.Buffer
malloc(int capacity)
Returns a newBGFXVertexLayout.Buffer
instance allocated withmemAlloc
.static BGFXVertexLayout
mallocStack()
Returns a newBGFXVertexLayout
instance allocated on the thread-localMemoryStack
.static BGFXVertexLayout.Buffer
mallocStack(int capacity)
Returns a newBGFXVertexLayout.Buffer
instance allocated on the thread-localMemoryStack
.static BGFXVertexLayout.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newBGFXVertexLayout.Buffer
instance allocated on the specifiedMemoryStack
.static BGFXVertexLayout
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newBGFXVertexLayout
instance allocated on the specifiedMemoryStack
.static java.nio.ShortBuffer
nattributes(long struct)
Unsafe version ofattributes()
.static short
nattributes(long struct, int index)
Unsafe version ofattributes
.static void
nattributes(long struct, int index, short value)
Unsafe version ofattributes
.static void
nattributes(long struct, java.nio.ShortBuffer value)
Unsafe version ofattributes
.static int
nhash(long struct)
Unsafe version ofhash()
.static void
nhash(long struct, int value)
Unsafe version ofhash
.static java.nio.ShortBuffer
noffset(long struct)
Unsafe version ofoffset()
.static short
noffset(long struct, int index)
Unsafe version ofoffset
.static void
noffset(long struct, int index, short value)
Unsafe version ofoffset
.static void
noffset(long struct, java.nio.ShortBuffer value)
Unsafe version ofoffset
.static short
nstride(long struct)
Unsafe version ofstride()
.static void
nstride(long struct, short value)
Unsafe version ofstride
.java.nio.ShortBuffer
offset()
Returns aShortBuffer
view of theoffset
field.short
offset(int index)
Returns the value at the specified index of theoffset
field.BGFXVertexLayout
offset(int index, short value)
Sets the specified value at the specified index of theoffset
field.BGFXVertexLayout
offset(java.nio.ShortBuffer value)
Copies the specifiedShortBuffer
to theoffset
field.BGFXVertexLayout
set(int hash, short stride, java.nio.ShortBuffer offset, java.nio.ShortBuffer attributes)
Initializes this struct with the specified values.BGFXVertexLayout
set(BGFXVertexLayout src)
Copies the specified struct data to this struct.int
sizeof()
short
stride()
Returns the value of thestride
field.BGFXVertexLayout
stride(short value)
Sets the specified value to thestride
field.
-
-
-
Constructor Detail
-
BGFXVertexLayout
public BGFXVertexLayout(java.nio.ByteBuffer container)
Creates aBGFXVertexLayout
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
-
hash
public int hash()
Returns the value of thehash
field.
-
stride
public short stride()
Returns the value of thestride
field.
-
offset
public java.nio.ShortBuffer offset()
Returns aShortBuffer
view of theoffset
field.
-
offset
public short offset(int index)
Returns the value at the specified index of theoffset
field.
-
attributes
public java.nio.ShortBuffer attributes()
Returns aShortBuffer
view of theattributes
field.
-
attributes
public short attributes(int index)
Returns the value at the specified index of theattributes
field.
-
hash
public BGFXVertexLayout hash(int value)
Sets the specified value to thehash
field.
-
stride
public BGFXVertexLayout stride(short value)
Sets the specified value to thestride
field.
-
offset
public BGFXVertexLayout offset(java.nio.ShortBuffer value)
Copies the specifiedShortBuffer
to theoffset
field.
-
offset
public BGFXVertexLayout offset(int index, short value)
Sets the specified value at the specified index of theoffset
field.
-
attributes
public BGFXVertexLayout attributes(java.nio.ShortBuffer value)
Copies the specifiedShortBuffer
to theattributes
field.
-
attributes
public BGFXVertexLayout attributes(int index, short value)
Sets the specified value at the specified index of theattributes
field.
-
set
public BGFXVertexLayout set(int hash, short stride, java.nio.ShortBuffer offset, java.nio.ShortBuffer attributes)
Initializes this struct with the specified values.
-
set
public BGFXVertexLayout set(BGFXVertexLayout src)
Copies the specified struct data to this struct.- Parameters:
src
- the source struct- Returns:
- this struct
-
malloc
public static BGFXVertexLayout malloc()
Returns a newBGFXVertexLayout
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static BGFXVertexLayout calloc()
Returns a newBGFXVertexLayout
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static BGFXVertexLayout create()
Returns a newBGFXVertexLayout
instance allocated withBufferUtils
.
-
create
public static BGFXVertexLayout create(long address)
Returns a newBGFXVertexLayout
instance for the specified memory address.
-
createSafe
@Nullable public static BGFXVertexLayout createSafe(long address)
-
malloc
public static BGFXVertexLayout.Buffer malloc(int capacity)
Returns a newBGFXVertexLayout.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static BGFXVertexLayout.Buffer calloc(int capacity)
Returns a newBGFXVertexLayout.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static BGFXVertexLayout.Buffer create(int capacity)
Returns a newBGFXVertexLayout.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static BGFXVertexLayout.Buffer create(long address, int capacity)
Create aBGFXVertexLayout.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
@Nullable public static BGFXVertexLayout.Buffer createSafe(long address, int capacity)
-
mallocStack
public static BGFXVertexLayout mallocStack()
Returns a newBGFXVertexLayout
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static BGFXVertexLayout callocStack()
Returns a newBGFXVertexLayout
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static BGFXVertexLayout mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newBGFXVertexLayout
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static BGFXVertexLayout callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newBGFXVertexLayout
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
mallocStack
public static BGFXVertexLayout.Buffer mallocStack(int capacity)
Returns a newBGFXVertexLayout.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static BGFXVertexLayout.Buffer callocStack(int capacity)
Returns a newBGFXVertexLayout.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacity
-
mallocStack
public static BGFXVertexLayout.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newBGFXVertexLayout.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
callocStack
public static BGFXVertexLayout.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newBGFXVertexLayout.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
nhash
public static int nhash(long struct)
Unsafe version ofhash()
.
-
nstride
public static short nstride(long struct)
Unsafe version ofstride()
.
-
noffset
public static java.nio.ShortBuffer noffset(long struct)
Unsafe version ofoffset()
.
-
noffset
public static short noffset(long struct, int index)
Unsafe version ofoffset
.
-
nattributes
public static java.nio.ShortBuffer nattributes(long struct)
Unsafe version ofattributes()
.
-
nattributes
public static short nattributes(long struct, int index)
Unsafe version ofattributes
.
-
nhash
public static void nhash(long struct, int value)
Unsafe version ofhash
.
-
nstride
public static void nstride(long struct, short value)
Unsafe version ofstride
.
-
noffset
public static void noffset(long struct, java.nio.ShortBuffer value)
Unsafe version ofoffset
.
-
noffset
public static void noffset(long struct, int index, short value)
Unsafe version ofoffset
.
-
nattributes
public static void nattributes(long struct, java.nio.ShortBuffer value)
Unsafe version ofattributes
.
-
nattributes
public static void nattributes(long struct, int index, short value)
Unsafe version ofattributes
.
-
-