public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataEditable
DEBUG
Constructor and Description |
---|
GLArrayDataServer(GLArrayDataServer src)
Copy Constructor
|
Modifier and Type | Method and Description |
---|---|
GLArrayData |
addFixedSubArray(int index,
int comps,
int vboTarget)
Configure a segment of this fixed function interleaved array (see
createFixedInterleaved(int, int, boolean, int, int) ). |
GLArrayData |
addGLSLSubArray(String name,
int comps,
int vboTarget)
Configure a segment of this GLSL interleaved array (see
createGLSLInterleaved(int, int, boolean, int, int) ). |
static GLArrayDataServer |
createData(int compsPerElement,
int dataType,
int stride,
Buffer buffer,
int vboUsage,
int vboTarget)
Create a VBO data object for any target w/o render pipeline association, ie
GL.GL_ELEMENT_ARRAY_BUFFER . |
static GLArrayDataServer |
createData(int compsPerElement,
int dataType,
int initialElementCount,
int vboUsage,
int vboTarget)
Create a VBO data object for any target w/o render pipeline association, ie
GL.GL_ELEMENT_ARRAY_BUFFER . |
static GLArrayDataServer |
createDataMapped(int compsPerElement,
int dataType,
int mappedElementCount,
int vboUsage,
int vboTarget)
Create a VBO data object for any target w/o render pipeline association, i.e.
|
static GLArrayDataServer |
createFixed(int index,
int compsPerElement,
int dataType,
boolean normalized,
int stride,
Buffer buffer,
int vboUsage)
Create a VBO, using a predefined fixed function array index
and starting with a given Buffer object incl it's stride
On profiles GL2 and ES1 the fixed function pipeline behavior is as expected.
|
static GLArrayDataServer |
createFixed(int index,
int compsPerElement,
int dataType,
boolean normalized,
int initialElementCount,
int vboUsage)
Create a VBO, using a predefined fixed function array index
and starting with a new created Buffer object with initialElementCount size
On profiles GL2 and ES1 the fixed function pipeline behavior is as expected.
|
static GLArrayDataServer |
createFixedInterleaved(int compsPerElement,
int dataType,
boolean normalized,
int stride,
Buffer buffer,
int vboUsage)
Create a VBO for fixed function interleaved array data
starting with a given Buffer object incl it's stride
|
static GLArrayDataServer |
createFixedInterleaved(int compsPerElement,
int dataType,
boolean normalized,
int initialElementCount,
int vboUsage)
Create a VBO for fixed function interleaved array data
starting with a new created Buffer object with initialElementCount size.
|
static GLArrayDataServer |
createFixedInterleavedMapped(int compsPerElement,
int dataType,
boolean normalized,
int mappedElementCount,
int vboUsage)
Create a VBO for fixed function interleaved array data
intended for GPU buffer storage mapping, see
GLBufferStorage , via mapStorage(GL, int) and mapStorage(GL, long, long, int) . |
static GLArrayDataServer |
createGLSL(String name,
int compsPerElement,
int dataType,
boolean normalized,
int stride,
Buffer buffer,
int vboUsage)
Create a VBO, using a custom GLSL array attribute name
and starting with a given Buffer object incl it's stride
|
static GLArrayDataServer |
createGLSL(String name,
int compsPerElement,
int dataType,
boolean normalized,
int initialElementCount,
int vboUsage)
Create a VBO, using a custom GLSL array attribute name
and starting with a new created Buffer object with initialElementCount size
|
static GLArrayDataServer |
createGLSLInterleaved(int compsPerElement,
int dataType,
boolean normalized,
int stride,
Buffer buffer,
int vboUsage)
Create a VBO for GLSL interleaved array data
starting with a given Buffer object incl it's stride
|
static GLArrayDataServer |
createGLSLInterleaved(int compsPerElement,
int dataType,
boolean normalized,
int initialElementCount,
int vboUsage)
Create a VBO for GLSL interleaved array data
starting with a new created Buffer object with initialElementCount size.
|
static GLArrayDataServer |
createGLSLInterleavedMapped(int compsPerElement,
int dataType,
boolean normalized,
int mappedElementCount,
int vboUsage)
Create a VBO for GLSL interleaved array data
intended for GPU buffer storage mapping, see
GLBufferStorage , via mapStorage(GL, int) and mapStorage(GL, long, long, int) . |
static GLArrayDataServer |
createGLSLMapped(String name,
int compsPerElement,
int dataType,
boolean normalized,
int mappedElementCount,
int vboUsage)
Create a VBO, using a custom GLSL array attribute name
intended for GPU buffer storage mapping, see
GLBufferStorage , via mapStorage(GL, int) and mapStorage(GL, long, long, int) . |
void |
destroy(GL gl) |
int |
getInterleavedOffset() |
GLBufferStorage |
mapStorage(GL gl,
int access) |
GLBufferStorage |
mapStorage(GL gl,
long offset,
long length,
int access) |
void |
setInterleavedOffset(int interleavedOffset) |
void |
setVBOEnabled(boolean vboUsage)
Convenient way do disable the VBO behavior and
switch to client side data one
Only possible if buffer is defined.
|
String |
toString() |
void |
unmapStorage(GL gl) |
associate, bindBuffer, createFixed, createFixed, createGLSL, createGLSL, enableBuffer, enabled, isVBOWritten, padding, put, putb, putf, puti, puts, putx, reset, reset, rewind, seal, seal, sealed, setEnableAlways, setVBOWritten
createFixed, createFixed, createGLSL, createGLSL, getBuffer, getBufferClass, getBufferClass, getComponentCount, getComponentSizeInBytes, getComponentType, getElementCount, getIndex, getLocation, getName, getNormalized, getSizeInBytes, getStride, getVBOName, getVBOOffset, getVBOTarget, getVBOUsage, isVBO, isVertexAttribute, setLocation, setLocation, setLocation, setName, setVBOName, setVBOTarget, setVBOUsage, validate
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
bindBuffer, enableBuffer, enabled, isVBOWritten, padding, put, putb, putf, puti, puts, putx, reset, reset, rewind, seal, seal, sealed, setEnableAlways, setVBOWritten
associate, getBuffer, getComponentCount, getComponentSizeInBytes, getComponentType, getElementCount, getIndex, getLocation, getName, getNormalized, getSizeInBytes, getStride, getVBOName, getVBOOffset, getVBOTarget, getVBOUsage, isVBO, isVertexAttribute, setLocation, setLocation, setLocation, setName
public GLArrayDataServer(GLArrayDataServer src)
Buffer is sliced
, i.e. sharing content but using own state.
All other values are simply copied.
public static GLArrayDataServer createFixed(int index, int compsPerElement, int dataType, boolean normalized, int stride, Buffer buffer, int vboUsage) throws GLException
GLPointerFuncUtil.getPredefinedArrayIndexName(int)
.index
- The GL array indexcompsPerElement
- component count per elementdataType
- The component's OpenGL data typenormalized
- Whether the data shall be normalizedstride
- in bytes from one element to the other. If zero, compsPerElement * compSizeInBytesbuffer
- the user define datavboUsage
- GL2ES2.GL_STREAM_DRAW
, GL.GL_STATIC_DRAW
or GL.GL_DYNAMIC_DRAW
GLException
com.jogamp.opengl.GLContext#getPredefinedArrayIndexName(int)
public static GLArrayDataServer createFixed(int index, int compsPerElement, int dataType, boolean normalized, int initialElementCount, int vboUsage) throws GLException
GLPointerFuncUtil.getPredefinedArrayIndexName(int)
.index
- The GL array indexcompsPerElement
- component count per elementdataType
- The component's OpenGL data typenormalized
- Whether the data shall be normalizedinitialElementCount
- vboUsage
- GL2ES2.GL_STREAM_DRAW
, GL.GL_STATIC_DRAW
or GL.GL_DYNAMIC_DRAW
GLException
com.jogamp.opengl.GLContext#getPredefinedArrayIndexName(int)
public static GLArrayDataServer createGLSL(String name, int compsPerElement, int dataType, boolean normalized, int initialElementCount, int vboUsage) throws GLException
name
- The custom name for the GL attributecompsPerElement
- component count per elementdataType
- The component's OpenGL data typenormalized
- Whether the data shall be normalizedinitialElementCount
- vboUsage
- GL2ES2.GL_STREAM_DRAW
, GL.GL_STATIC_DRAW
or GL.GL_DYNAMIC_DRAW
GLException
public static GLArrayDataServer createGLSLMapped(String name, int compsPerElement, int dataType, boolean normalized, int mappedElementCount, int vboUsage) throws GLException
GLBufferStorage
, via mapStorage(GL, int)
and mapStorage(GL, long, long, int)
.name
- The custom name for the GL attributecompsPerElement
- component count per elementdataType
- The component's OpenGL data typenormalized
- Whether the data shall be normalizedmappedElementCount
- vboUsage
- GL2ES2.GL_STREAM_DRAW
, GL.GL_STATIC_DRAW
or GL.GL_DYNAMIC_DRAW
GLException
public static GLArrayDataServer createGLSL(String name, int compsPerElement, int dataType, boolean normalized, int stride, Buffer buffer, int vboUsage) throws GLException
name
- The custom name for the GL attributecompsPerElement
- component count per elementdataType
- The component's OpenGL data typenormalized
- Whether the data shall be normalizedstride
- in bytes from one element to the other. If zero, compsPerElement * compSizeInBytesbuffer
- the user define datavboUsage
- GL2ES2.GL_STREAM_DRAW
, GL.GL_STATIC_DRAW
or GL.GL_DYNAMIC_DRAW
GLException
public static GLArrayDataServer createData(int compsPerElement, int dataType, int stride, Buffer buffer, int vboUsage, int vboTarget) throws GLException
GL.GL_ELEMENT_ARRAY_BUFFER
.
Hence no index, name for a fixed function pipeline nor vertex attribute is given.compsPerElement
- component count per elementdataType
- The component's OpenGL data typestride
- in bytes from one element to the other. If zero, compsPerElement * compSizeInBytesbuffer
- the user define datavboUsage
- GL2ES2.GL_STREAM_DRAW
, GL.GL_STATIC_DRAW
or GL.GL_DYNAMIC_DRAW
vboTarget
- GL.GL_ELEMENT_ARRAY_BUFFER
, ..
{@link GL#glGenBuffers(int, int[], int)GLException
public static GLArrayDataServer createData(int compsPerElement, int dataType, int initialElementCount, int vboUsage, int vboTarget) throws GLException
GL.GL_ELEMENT_ARRAY_BUFFER
.
Hence no index, name for a fixed function pipeline nor vertex attribute is given.compsPerElement
- component count per elementdataType
- The component's OpenGL data typeinitialElementCount
- vboUsage
- GL2ES2.GL_STREAM_DRAW
, GL.GL_STATIC_DRAW
or GL.GL_DYNAMIC_DRAW
vboTarget
- GL.GL_ELEMENT_ARRAY_BUFFER
, ..GLException
public static GLArrayDataServer createDataMapped(int compsPerElement, int dataType, int mappedElementCount, int vboUsage, int vboTarget) throws GLException
GL.GL_ELEMENT_ARRAY_BUFFER
,
intended for GPU buffer storage mapping, see GLBufferStorage
, via mapStorage(GL, int)
and mapStorage(GL, long, long, int)
.
No index, name for a fixed function pipeline nor vertex attribute is given.
compsPerElement
- component count per elementdataType
- The component's OpenGL data typeinitialElementCount
- vboUsage
- GL2ES2.GL_STREAM_DRAW
, GL.GL_STATIC_DRAW
or GL.GL_DYNAMIC_DRAW
vboTarget
- GL.GL_ELEMENT_ARRAY_BUFFER
, ..GLException
public static GLArrayDataServer createFixedInterleaved(int compsPerElement, int dataType, boolean normalized, int initialElementCount, int vboUsage) throws GLException
User needs to configure the interleaved segments via addFixedSubArray(int, int, int)
.
compsPerElement
- The total number of all interleaved components per element.dataType
- The component's OpenGL data typenormalized
- Whether the data shall be normalizedinitialElementCount
- The initial number of all interleaved elementsvboUsage
- GL2ES2.GL_STREAM_DRAW
, GL.GL_STATIC_DRAW
or GL.GL_DYNAMIC_DRAW
GLException
public static GLArrayDataServer createFixedInterleavedMapped(int compsPerElement, int dataType, boolean normalized, int mappedElementCount, int vboUsage) throws GLException
GLBufferStorage
, via mapStorage(GL, int)
and mapStorage(GL, long, long, int)
.
User needs to configure the interleaved segments via addFixedSubArray(int, int, int)
.
compsPerElement
- The total number of all interleaved components per element.dataType
- The component's OpenGL data typenormalized
- Whether the data shall be normalizedmappedElementCount
- The total number of all interleaved elementsvboUsage
- GL2ES2.GL_STREAM_DRAW
, GL.GL_STATIC_DRAW
or GL.GL_DYNAMIC_DRAW
GLException
public static GLArrayDataServer createFixedInterleaved(int compsPerElement, int dataType, boolean normalized, int stride, Buffer buffer, int vboUsage) throws GLException
User needs to configure the interleaved segments via addFixedSubArray(int, int, int)
.
compsPerElement
- The total number of all interleaved components per element.dataType
- The component's OpenGL data typenormalized
- Whether the data shall be normalizedstride
- in bytes from one element of a sub-array to the other. If zero, compsPerElement * compSizeInBytesbuffer
- The user define data of all interleaved elementsvboUsage
- GL2ES2.GL_STREAM_DRAW
, GL.GL_STATIC_DRAW
or GL.GL_DYNAMIC_DRAW
GLException
public GLArrayData addFixedSubArray(int index, int comps, int vboTarget)
createFixedInterleaved(int, int, boolean, int, int)
).
This method may be called several times as long the sum of interleaved components does not exceed the total component count of the created interleaved array.
The memory of the the interleaved array is being used.
Must be called before using the array, eg: GLArrayDataClient.seal(boolean)
, GLArrayDataClient.putf(float)
, ..
index
- The GL array index, maybe -1 if vboTarget is GL.GL_ELEMENT_ARRAY_BUFFER
comps
- This interleaved array segment's component count per elementvboTarget
- GL.GL_ARRAY_BUFFER
or GL.GL_ELEMENT_ARRAY_BUFFER
public static GLArrayDataServer createGLSLInterleaved(int compsPerElement, int dataType, boolean normalized, int initialElementCount, int vboUsage) throws GLException
User needs to configure the interleaved segments via #addGLSLSubArray(int, int, int)
.
compsPerElement
- The total number of all interleaved components per element.dataType
- The component's OpenGL data typenormalized
- Whether the data shall be normalizedinitialElementCount
- The initial number of all interleaved elementsvboUsage
- GL2ES2.GL_STREAM_DRAW
, GL.GL_STATIC_DRAW
or GL.GL_DYNAMIC_DRAW
GLException
public static GLArrayDataServer createGLSLInterleavedMapped(int compsPerElement, int dataType, boolean normalized, int mappedElementCount, int vboUsage) throws GLException
GLBufferStorage
, via mapStorage(GL, int)
and mapStorage(GL, long, long, int)
.
User needs to configure the interleaved segments via #addGLSLSubArray(int, int, int)
.
compsPerElement
- The total number of all interleaved components per element.dataType
- The component's OpenGL data typenormalized
- Whether the data shall be normalizedmappedElementCount
- The total number of all interleaved elementsvboUsage
- GL2ES2.GL_STREAM_DRAW
, GL.GL_STATIC_DRAW
or GL.GL_DYNAMIC_DRAW
GLException
public static GLArrayDataServer createGLSLInterleaved(int compsPerElement, int dataType, boolean normalized, int stride, Buffer buffer, int vboUsage) throws GLException
User needs to configure the interleaved segments via #addGLSLSubArray(int, int, int)
.
compsPerElement
- The total number of all interleaved components per element.dataType
- The component's OpenGL data typenormalized
- Whether the data shall be normalizedstride
- in bytes from one element of a sub-array to the other. If zero, compsPerElement * compSizeInBytesbuffer
- The user define data of all interleaved elementsvboUsage
- GL2ES2.GL_STREAM_DRAW
, GL.GL_STATIC_DRAW
or GL.GL_DYNAMIC_DRAW
GLException
public GLArrayData addGLSLSubArray(String name, int comps, int vboTarget)
createGLSLInterleaved(int, int, boolean, int, int)
).
This method may be called several times as long the sum of interleaved components does not exceed the total component count of the created interleaved array.
The memory of the the interleaved array is being used.
Must be called before using the array, eg: GLArrayDataClient.seal(boolean)
, GLArrayDataClient.putf(float)
, ..
name
- The custom name for the GL attribute, maybe null if vboTarget is GL.GL_ELEMENT_ARRAY_BUFFER
comps
- This interleaved array segment's component count per elementvboTarget
- GL.GL_ARRAY_BUFFER
or GL.GL_ELEMENT_ARRAY_BUFFER
public final void setInterleavedOffset(int interleavedOffset)
public final int getInterleavedOffset()
public void destroy(GL gl)
destroy
in interface GLArrayData
destroy
in interface GLArrayDataEditable
destroy
in class GLArrayDataClient
public void setVBOEnabled(boolean vboUsage)
setVBOEnabled
in class GLArrayDataWrapper
GLArrayDataWrapper.setVBOName(int)
public GLBufferStorage mapStorage(GL gl, int access)
public GLBufferStorage mapStorage(GL gl, long offset, long length, int access)
public void unmapStorage(GL gl)
public String toString()
toString
in interface GLArrayData
toString
in class GLArrayDataClient
Copyright 2010 JogAmp Community.