Immediate mode sink, implementing OpenGL fixed function subset of immediate mode operations, i.e.
glBegin();
glVertex3f(1f, 1f, 1f);
glColor4f(1f, 1f, 1f, 1f);
...
glEnd();
Implementation buffers all vertex, colors, normal and texture-coord elements in their respective buffers
to be either rendered directly via glEnd(GL) or to be added to an internal display list
via glEnd(gl, false) for deferred rendering via draw(GL, boolean).
createFixed(..)
and createGLSL(..)
If unsure whether colors, normals and textures will be used,
simply add them with an expected component count.
This implementation will only render buffers which are being filled.
The buffer growing implementation will only grow the exceeded buffers, unused buffers are not resized.
Note
Optional types, i.e. color, must be either not used or used w/ the same element count as vertex, etc. This is a semantic constraint, same as in the original OpenGL spec.
| Modifier and Type | Class and Description |
|---|---|
| protected static class |
| Modifier and Type | Field and Description |
|---|---|
| protected static final boolean | |
| protected static final boolean | |
| protected static final boolean | |
| public static final int | |
| public static final int | |
| public static final int | |
| private ImmModeSink. | |
| private final ArrayList |
| Access | Constructor and Description |
|---|---|
| protected | ImmModeSink(final int initialElementCount, final int vComps, final int vDataType, final int cComps, final int cDataType, final int nComps, final int nDataType, final int tComps, final int tDataType, final boolean useGLSL, final int glBufferUsage, final ShaderState st, final int shaderProgram)
|
| Modifier and Type | Method and Description |
|---|---|
| public static ImmModeSink | createFixed(final int
initial buffer size, if subsequent mutable operations are about to exceed the buffer size, the buffer will grow about the initial size. initialElementCount, final int mandatory vertex component count, should be 2, 3 or 4. vComps, final int mandatory vertex data type, e.g. vDataType, final int GL#GL_FLOAToptional color component count, may be 0, 3 or 4 cComps, final int optional color data type, e.g. cDataType, final int GL#GL_FLOAToptional normal component count, may be 0, 3 or 4 nComps, final int optional normal data type, e.g. nDataType, final int GL#GL_FLOAToptional texture-coordinate component count, may be 0, 2 or 3 tComps, final int optional texture-coordinate data type, e.g. tDataType, final int GL#GL_FLOATVBO glBufferUsage)usage parameter for GL#glBufferData(int, long, Buffer, int), e.g. GL#GL_STATIC_DRAW,
set to 0 for no VBO usageUses a GL2ES1, or ES2 fixed function emulation immediate mode sink |
| public static ImmModeSink | createGLSL(final int
initial buffer size, if subsequent mutable operations are about to exceed the buffer size, the buffer will grow about the initial size. initialElementCount, final int mandatory vertex component count, should be 2, 3 or 4. vComps, final int mandatory vertex data type, e.g. vDataType, final int GL#GL_FLOAToptional color component count, may be 0, 3 or 4 cComps, final int optional color data type, e.g. cDataType, final int GL#GL_FLOAToptional normal component count, may be 0, 3 or 4 nComps, final int optional normal data type, e.g. nDataType, final int GL#GL_FLOAToptional texture-coordinate component count, may be 0, 2 or 3 tComps, final int optional texture-coordinate data type, e.g. tDataType, final int GL#GL_FLOATVBO glBufferUsage, final ShaderState usage parameter for GL#glBufferData(int, long, Buffer, int), e.g. GL#GL_STATIC_DRAW,
set to 0 for no VBO usageShaderState to locate the vertex attributes st)Uses a GL2ES2 GLSL shader immediate mode sink, utilizing the given ShaderState. |
| public static ImmModeSink | createGLSL(final int
initial buffer size, if subsequent mutable operations are about to exceed the buffer size, the buffer will grow about the initial size. initialElementCount, final int mandatory vertex component count, should be 2, 3 or 4. vComps, final int mandatory vertex data type, e.g. vDataType, final int GL#GL_FLOAToptional color component count, may be 0, 3 or 4 cComps, final int optional color data type, e.g. cDataType, final int GL#GL_FLOAToptional normal component count, may be 0, 3 or 4 nComps, final int optional normal data type, e.g. nDataType, final int GL#GL_FLOAToptional texture-coordinate component count, may be 0, 2 or 3 tComps, final int optional texture-coordinate data type, e.g. tDataType, final int GL#GL_FLOATVBO glBufferUsage, final int usage parameter for GL#glBufferData(int, long, Buffer, int), e.g. GL#GL_STATIC_DRAW,
set to 0 for no VBO usageshader-program name to locate the vertex attributes shaderProgram)Uses a GL2ES2 GLSL shader immediate mode sink, utilizing the given shader-program. |
| public void | |
| private void | |
| public void | |
| public void | |
| public int | |
| public boolean | |
| public void | |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public void | |
| public final void | |
| public void | |
| public final void | |
| private void | |
| public final void | |
| public final void | |
| public final void | |
| public void | |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public void | |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public void | |
| public void | |
| public void | |
| public void | setResizeElementCount(final int v)
Sets the additional element count if buffer resize is required,
defaults to |
| public String |