JOGL v2.6.0-rc-20250706
JOGL, High-Performance Graphics Binding for Java™ (public API).
com.jogamp.opengl.util.ImmModeSink Class Reference
Collaboration diagram for com.jogamp.opengl.util.ImmModeSink:

Classes

class  VBOSet
 

Public Member Functions

void destroy (final GL gl)
 
void reset ()
 
void reset (final GL gl)
 
String toString ()
 
void draw (final GL gl, final boolean disableBufferAfterDraw)
 
void draw (final GL gl, final Buffer indices, final boolean disableBufferAfterDraw)
 
void glBegin (int mode)
 
final void glEnd (final GL gl)
 
void glEnd (final GL gl, final boolean immediateDraw)
 
final void glEnd (final GL gl, final Buffer indices)
 
void glVertexv (final Buffer v)
 
void glNormalv (final Buffer v)
 
void glColorv (final Buffer v)
 
void glTexCoordv (final Buffer v)
 
final void glVertex2f (final float x, final float y)
 
final void glVertex3f (final float x, final float y, final float z)
 
final void glNormal3f (final float x, final float y, final float z)
 
final void glColor3f (final float x, final float y, final float z)
 
final void glColor4f (final float x, final float y, final float z, final float a)
 
final void glTexCoord2f (final float x, final float y)
 
final void glTexCoord3f (final float x, final float y, final float z)
 
final void glVertex2s (final short x, final short y)
 
final void glVertex3s (final short x, final short y, final short z)
 
final void glNormal3s (final short x, final short y, final short z)
 
final void glColor3s (final short x, final short y, final short z)
 
final void glColor4s (final short x, final short y, final short z, final short a)
 
final void glTexCoord2s (final short x, final short y)
 
final void glTexCoord3s (final short x, final short y, final short z)
 
final void glVertex2b (final byte x, final byte y)
 
final void glVertex3b (final byte x, final byte y, final byte z)
 
final void glNormal3b (final byte x, final byte y, final byte z)
 
final void glColor3b (final byte x, final byte y, final byte z)
 
final void glColor3ub (final byte x, final byte y, final byte z)
 
final void glColor4b (final byte x, final byte y, final byte z, final byte a)
 
final void glColor4ub (final byte x, final byte y, final byte z, final byte a)
 
final void glTexCoord2b (final byte x, final byte y)
 
final void glTexCoord3b (final byte x, final byte y, final byte z)
 
boolean getUseVBO ()
 
int getResizeElementCount ()
 Returns the additional element count if buffer resize is required. More...
 
void setResizeElementCount (final int v)
 Sets the additional element count if buffer resize is required, defaults to initialElementCount of factory method. More...
 

Static Public Member Functions

static ImmModeSink createFixed (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 int glBufferUsage)
 Uses a GL2ES1, or ES2 fixed function emulation immediate mode sink. More...
 
static ImmModeSink createGLSL (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 int glBufferUsage, final ShaderState st)
 Uses a GL2ES2 GLSL shader immediate mode sink, utilizing the given ShaderState. More...
 
static ImmModeSink createGLSL (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 int glBufferUsage, final int shaderProgram)
 Uses a GL2ES2 GLSL shader immediate mode sink, utilizing the given shader-program. More...
 

Static Public Attributes

static final int GL_QUADS = 0x0007
 
static final int GL_QUAD_STRIP = 0x0008
 
static final int GL_POLYGON = 0x0009
 

Protected Member Functions

 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)
 

Static Protected Attributes

static final boolean DEBUG_BEGIN_END
 
static final boolean DEBUG_DRAW
 
static final boolean DEBUG_BUFFER
 

Detailed Description

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).

Buffer storage and it's creation via @javalink createFixed(int, int, int, int, int, int, int, int, int, int) createFixed(..)} and @javalink createGLSL(int, int, int, int, int, int, int, int, int, int, ShaderState) 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.

Definition at line 52 of file ImmModeSink.java.

Constructor & Destructor Documentation

◆ ImmModeSink()

com.jogamp.opengl.util.ImmModeSink.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 
)
protected

Definition at line 369 of file ImmModeSink.java.

Here is the caller graph for this function:

Member Function Documentation

◆ createFixed()

static ImmModeSink com.jogamp.opengl.util.ImmModeSink.createFixed ( 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 int  glBufferUsage 
)
static

Uses a GL2ES1, or ES2 fixed function emulation immediate mode sink.

See buffer storage details.

Parameters
initialElementCountinitial buffer size, if subsequent mutable operations are about to exceed the buffer size, the buffer will grow about the initial size.
vCompsmandatory vertex component count, should be 2, 3 or 4.
vDataTypemandatory vertex data type, e.g. GL#GL_FLOAT
cCompsoptional color component count, may be 0, 3 or 4
cDataTypeoptional color data type, e.g. GL#GL_FLOAT
nCompsoptional normal component count, may be 0, 3 or 4
nDataTypeoptional normal data type, e.g. GL#GL_FLOAT
tCompsoptional texture-coordinate component count, may be 0, 2 or 3
tDataTypeoptional texture-coordinate data type, e.g. GL#GL_FLOAT
glBufferUsageVBO usage parameter for GL#glBufferData(int, long, Buffer, int), e.g. GL#GL_STATIC_DRAW, set to 0 for no VBO usage

Definition at line 86 of file ImmModeSink.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createGLSL() [1/2]

static ImmModeSink com.jogamp.opengl.util.ImmModeSink.createGLSL ( 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 int  glBufferUsage,
final int  shaderProgram 
)
static

Uses a GL2ES2 GLSL shader immediate mode sink, utilizing the given shader-program.

See buffer storage details.

Parameters
initialElementCountinitial buffer size, if subsequent mutable operations are about to exceed the buffer size, the buffer will grow about the initial size.
vCompsmandatory vertex component count, should be 2, 3 or 4.
vDataTypemandatory vertex data type, e.g. GL#GL_FLOAT
cCompsoptional color component count, may be 0, 3 or 4
cDataTypeoptional color data type, e.g. GL#GL_FLOAT
nCompsoptional normal component count, may be 0, 3 or 4
nDataTypeoptional normal data type, e.g. GL#GL_FLOAT
tCompsoptional texture-coordinate component count, may be 0, 2 or 3
tDataTypeoptional texture-coordinate data type, e.g. GL#GL_FLOAT
glBufferUsageVBO usage parameter for GL#glBufferData(int, long, Buffer, int), e.g. GL#GL_STATIC_DRAW, set to 0 for no VBO usage
shaderProgramshader-program name to locate the vertex attributes
See also
draw(GL, boolean)
com.jogamp.opengl.util.glsl.ShaderState::useProgram(GL2ES2, boolean)
com.jogamp.opengl.util.glsl.ShaderState::getCurrentShaderState()

Definition at line 152 of file ImmModeSink.java.

Here is the call graph for this function:

◆ createGLSL() [2/2]

static ImmModeSink com.jogamp.opengl.util.ImmModeSink.createGLSL ( 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 int  glBufferUsage,
final ShaderState  st 
)
static

Uses a GL2ES2 GLSL shader immediate mode sink, utilizing the given ShaderState.

See buffer storage details.

Parameters
initialElementCountinitial buffer size, if subsequent mutable operations are about to exceed the buffer size, the buffer will grow about the initial size.
vCompsmandatory vertex component count, should be 2, 3 or 4.
vDataTypemandatory vertex data type, e.g. GL#GL_FLOAT
cCompsoptional color component count, may be 0, 3 or 4
cDataTypeoptional color data type, e.g. GL#GL_FLOAT
nCompsoptional normal component count, may be 0, 3 or 4
nDataTypeoptional normal data type, e.g. GL#GL_FLOAT
tCompsoptional texture-coordinate component count, may be 0, 2 or 3
tDataTypeoptional texture-coordinate data type, e.g. GL#GL_FLOAT
glBufferUsageVBO usage parameter for GL#glBufferData(int, long, Buffer, int), e.g. GL#GL_STATIC_DRAW, set to 0 for no VBO usage
stShaderState to locate the vertex attributes
See also
draw(GL, boolean)
com.jogamp.opengl.util.glsl.ShaderState::useProgram(GL2ES2, boolean)
com.jogamp.opengl.util.glsl.ShaderState::getCurrentShaderState()

Definition at line 119 of file ImmModeSink.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ destroy()

void com.jogamp.opengl.util.ImmModeSink.destroy ( final GL  gl)

Definition at line 163 of file ImmModeSink.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ draw() [1/2]

void com.jogamp.opengl.util.ImmModeSink.draw ( final GL  gl,
final boolean  disableBufferAfterDraw 
)

Definition at line 196 of file ImmModeSink.java.

Here is the caller graph for this function:

◆ draw() [2/2]

void com.jogamp.opengl.util.ImmModeSink.draw ( final GL  gl,
final Buffer  indices,
final boolean  disableBufferAfterDraw 
)

Definition at line 206 of file ImmModeSink.java.

◆ getResizeElementCount()

int com.jogamp.opengl.util.ImmModeSink.getResizeElementCount ( )

Returns the additional element count if buffer resize is required.

See also
setResizeElementCount(int)

Definition at line 387 of file ImmModeSink.java.

Here is the call graph for this function:

◆ getUseVBO()

boolean com.jogamp.opengl.util.ImmModeSink.getUseVBO ( )

Definition at line 381 of file ImmModeSink.java.

Here is the call graph for this function:

◆ glBegin()

void com.jogamp.opengl.util.ImmModeSink.glBegin ( int  mode)

Definition at line 216 of file ImmModeSink.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ glColor3b()

final void com.jogamp.opengl.util.ImmModeSink.glColor3b ( final byte  x,
final byte  y,
final byte  z 
)

Definition at line 345 of file ImmModeSink.java.

Here is the call graph for this function:

◆ glColor3f()

final void com.jogamp.opengl.util.ImmModeSink.glColor3f ( final float  x,
final float  y,
final float  z 
)

Definition at line 289 of file ImmModeSink.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ glColor3s()

final void com.jogamp.opengl.util.ImmModeSink.glColor3s ( final short  x,
final short  y,
final short  z 
)

Definition at line 317 of file ImmModeSink.java.

Here is the call graph for this function:

◆ glColor3ub()

final void com.jogamp.opengl.util.ImmModeSink.glColor3ub ( final byte  x,
final byte  y,
final byte  z 
)

Definition at line 349 of file ImmModeSink.java.

Here is the call graph for this function:

◆ glColor4b()

final void com.jogamp.opengl.util.ImmModeSink.glColor4b ( final byte  x,
final byte  y,
final byte  z,
final byte  a 
)

Definition at line 353 of file ImmModeSink.java.

Here is the call graph for this function:

◆ glColor4f()

final void com.jogamp.opengl.util.ImmModeSink.glColor4f ( final float  x,
final float  y,
final float  z,
final float  a 
)

Definition at line 293 of file ImmModeSink.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ glColor4s()

final void com.jogamp.opengl.util.ImmModeSink.glColor4s ( final short  x,
final short  y,
final short  z,
final short  a 
)

Definition at line 321 of file ImmModeSink.java.

Here is the call graph for this function:

◆ glColor4ub()

final void com.jogamp.opengl.util.ImmModeSink.glColor4ub ( final byte  x,
final byte  y,
final byte  z,
final byte  a 
)

Definition at line 357 of file ImmModeSink.java.

Here is the call graph for this function:

◆ glColorv()

void com.jogamp.opengl.util.ImmModeSink.glColorv ( final Buffer  v)

Definition at line 270 of file ImmModeSink.java.

Here is the call graph for this function:

◆ glEnd() [1/3]

final void com.jogamp.opengl.util.ImmModeSink.glEnd ( final GL  gl)

Definition at line 233 of file ImmModeSink.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ glEnd() [2/3]

void com.jogamp.opengl.util.ImmModeSink.glEnd ( final GL  gl,
final boolean  immediateDraw 
)

Definition at line 237 of file ImmModeSink.java.

Here is the call graph for this function:

◆ glEnd() [3/3]

final void com.jogamp.opengl.util.ImmModeSink.glEnd ( final GL  gl,
final Buffer  indices 
)

Definition at line 241 of file ImmModeSink.java.

Here is the call graph for this function:

◆ glNormal3b()

final void com.jogamp.opengl.util.ImmModeSink.glNormal3b ( final byte  x,
final byte  y,
final byte  z 
)

Definition at line 341 of file ImmModeSink.java.

Here is the call graph for this function:

◆ glNormal3f()

final void com.jogamp.opengl.util.ImmModeSink.glNormal3f ( final float  x,
final float  y,
final float  z 
)

Definition at line 285 of file ImmModeSink.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ glNormal3s()

final void com.jogamp.opengl.util.ImmModeSink.glNormal3s ( final short  x,
final short  y,
final short  z 
)

Definition at line 313 of file ImmModeSink.java.

Here is the call graph for this function:

◆ glNormalv()

void com.jogamp.opengl.util.ImmModeSink.glNormalv ( final Buffer  v)

Definition at line 267 of file ImmModeSink.java.

Here is the call graph for this function:

◆ glTexCoord2b()

final void com.jogamp.opengl.util.ImmModeSink.glTexCoord2b ( final byte  x,
final byte  y 
)

Definition at line 361 of file ImmModeSink.java.

Here is the call graph for this function:

◆ glTexCoord2f()

final void com.jogamp.opengl.util.ImmModeSink.glTexCoord2f ( final float  x,
final float  y 
)

Definition at line 297 of file ImmModeSink.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ glTexCoord2s()

final void com.jogamp.opengl.util.ImmModeSink.glTexCoord2s ( final short  x,
final short  y 
)

Definition at line 325 of file ImmModeSink.java.

Here is the call graph for this function:

◆ glTexCoord3b()

final void com.jogamp.opengl.util.ImmModeSink.glTexCoord3b ( final byte  x,
final byte  y,
final byte  z 
)

Definition at line 365 of file ImmModeSink.java.

Here is the call graph for this function:

◆ glTexCoord3f()

final void com.jogamp.opengl.util.ImmModeSink.glTexCoord3f ( final float  x,
final float  y,
final float  z 
)

Definition at line 301 of file ImmModeSink.java.

Here is the call graph for this function:

◆ glTexCoord3s()

final void com.jogamp.opengl.util.ImmModeSink.glTexCoord3s ( final short  x,
final short  y,
final short  z 
)

Definition at line 329 of file ImmModeSink.java.

Here is the call graph for this function:

◆ glTexCoordv()

void com.jogamp.opengl.util.ImmModeSink.glTexCoordv ( final Buffer  v)

Definition at line 273 of file ImmModeSink.java.

Here is the call graph for this function:

◆ glVertex2b()

final void com.jogamp.opengl.util.ImmModeSink.glVertex2b ( final byte  x,
final byte  y 
)

Definition at line 333 of file ImmModeSink.java.

Here is the call graph for this function:

◆ glVertex2f()

final void com.jogamp.opengl.util.ImmModeSink.glVertex2f ( final float  x,
final float  y 
)

Definition at line 277 of file ImmModeSink.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ glVertex2s()

final void com.jogamp.opengl.util.ImmModeSink.glVertex2s ( final short  x,
final short  y 
)

Definition at line 305 of file ImmModeSink.java.

Here is the call graph for this function:

◆ glVertex3b()

final void com.jogamp.opengl.util.ImmModeSink.glVertex3b ( final byte  x,
final byte  y,
final byte  z 
)

Definition at line 337 of file ImmModeSink.java.

Here is the call graph for this function:

◆ glVertex3f()

final void com.jogamp.opengl.util.ImmModeSink.glVertex3f ( final float  x,
final float  y,
final float  z 
)

Definition at line 281 of file ImmModeSink.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ glVertex3s()

final void com.jogamp.opengl.util.ImmModeSink.glVertex3s ( final short  x,
final short  y,
final short  z 
)

Definition at line 309 of file ImmModeSink.java.

Here is the call graph for this function:

◆ glVertexv()

void com.jogamp.opengl.util.ImmModeSink.glVertexv ( final Buffer  v)

Definition at line 264 of file ImmModeSink.java.

Here is the call graph for this function:

◆ reset() [1/2]

void com.jogamp.opengl.util.ImmModeSink.reset ( )

Definition at line 169 of file ImmModeSink.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reset() [2/2]

void com.jogamp.opengl.util.ImmModeSink.reset ( final GL  gl)

Definition at line 173 of file ImmModeSink.java.

Here is the call graph for this function:

◆ setResizeElementCount()

void com.jogamp.opengl.util.ImmModeSink.setResizeElementCount ( final int  v)

Sets the additional element count if buffer resize is required, defaults to initialElementCount of factory method.

See also
createFixed(int, int, int, int, int, int, int, int, int, int)
createGLSL(int, int, int, int, int, int, int, int, int, int, ShaderState)

Definition at line 395 of file ImmModeSink.java.

Here is the call graph for this function:

◆ toString()

String com.jogamp.opengl.util.ImmModeSink.toString ( )

Definition at line 179 of file ImmModeSink.java.

Member Data Documentation

◆ DEBUG_BEGIN_END

final boolean com.jogamp.opengl.util.ImmModeSink.DEBUG_BEGIN_END
staticprotected

Definition at line 53 of file ImmModeSink.java.

◆ DEBUG_BUFFER

final boolean com.jogamp.opengl.util.ImmModeSink.DEBUG_BUFFER
staticprotected

Definition at line 55 of file ImmModeSink.java.

◆ DEBUG_DRAW

final boolean com.jogamp.opengl.util.ImmModeSink.DEBUG_DRAW
staticprotected

Definition at line 54 of file ImmModeSink.java.

◆ GL_POLYGON

final int com.jogamp.opengl.util.ImmModeSink.GL_POLYGON = 0x0009
static

Definition at line 66 of file ImmModeSink.java.

◆ GL_QUAD_STRIP

final int com.jogamp.opengl.util.ImmModeSink.GL_QUAD_STRIP = 0x0008
static

Definition at line 65 of file ImmModeSink.java.

◆ GL_QUADS

final int com.jogamp.opengl.util.ImmModeSink.GL_QUADS = 0x0007
static

Definition at line 64 of file ImmModeSink.java.


The documentation for this class was generated from the following file: