Class BufferLayout
java.lang.Object
com.jme3.shader.bufferobject.layout.BufferLayout
- Direct Known Subclasses:
RawLayout
,Std140Layout
Layout serializer for buffers
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
align
(int pos, int basicAlignment) Align a position to the given basicAlignmentint
Estimate size of Object when serialized accordingly with std140int
Get basic alignment of Object when serialized accordingly with std140abstract String
getId()
protected BufferLayout.ObjectSerializer<?>
getSerializer
(Object obj) protected void
registerSerializer
(BufferLayout.ObjectSerializer<?> serializer) Register a serializervoid
write
(ByteBuffer out, Object o) Serialize an object accordingly with the std140 layout and write the result to a BufferObject
-
Field Details
-
serializers
-
-
Constructor Details
-
BufferLayout
public BufferLayout()
-
-
Method Details
-
getSerializer
-
registerSerializer
Register a serializer- Parameters:
type
-
-
estimateSize
Estimate size of Object when serialized accordingly with std140- Parameters:
o
- the object to serialize- Returns:
- the size
-
getBasicAlignment
Get basic alignment of Object when serialized accordingly with std140- Parameters:
o
- the object to serialize- Returns:
- the basic alignment
-
align
public int align(int pos, int basicAlignment) Align a position to the given basicAlignment- Parameters:
pos
- the position to alignbasicAlignment
- the basic alignment- Returns:
- the aligned position
-
write
Serialize an object accordingly with the std140 layout and write the result to a BufferObject- Parameters:
out
- the output BufferObject where the object will be serialized (starting from the current position)o
- the Object to serialize
-
getId
-