MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
Loading...
Searching...
No Matches

Detailed Description

The OpenGL drawing surface internally tracks parts of the OpenGL state in order to allow lazy state setting during a draw. This improves performance by removing redundant state changes.

This class provides access to this internal tracker. If changes to the Open GL state done outside of MapLink are performed through this state tracker, then the drawing surface will automatically make the necessary state changes to correctly draw. Otherwise, the user must manually reverse any OpenGL state changes they make prior to invoking a draw or returning control to the drawing surface from a custom data layer.

Any OpenGL functionality not offered through this state tracker is not tracked, and must be reset manually to the default state if it will affect subsequent drawing.

Public Member Functions

bool bindBuffer (GLenum target, GLuint buffer)
 
void bindFramebuffer (GLenum target, GLuint framebuffer)
 
void deleteFramebuffer (GLuint framebuffer)
 
void bindTexture (GLenum textureUnit, GLenum target, GLuint texture)
 
GLuint bindVertexArrayObject (GLuint vao)
 
void blendFunc (GLenum sfactor, GLenum dfactor)
 
void depthFunction (GLenum func)
 
void disableBlending ()
 
void disableDepthTest ()
 
void disableMultisample ()
 
void disablePointSprites ()
 
void disablePrimitiveRestart ()
 
void disableVertexAttribArray (GLuint index)
 
void enableBlending ()
 
void enableDepthTest ()
 
void enableMultisample ()
 
void enablePrimitiveRestart ()
 
void enablePointSprites ()
 
void enableVertexAttribArray (GLuint index)
 
void primitiveRestartIndex (GLuint index)
 
void reset ()
 
void resetDefault ()
 TODO - this method has not been implemented.
 
void resetTextures ()
 TODO - this method has not been implemented.
 
void useProgram (GLuint program)
 
void vertexAttribPointer (GLuint buffer, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer)
 

Member Function Documentation

◆ bindBuffer()

bool TSLOpenGLStateTracker::bindBuffer ( GLenum target,
GLuint buffer )

This function is equivalent to:

glBindBuffer( target, buffer )

Only the following targets are tracked:

  • GL_ARRAY_BUFFER
  • GL_ELEMENT_ARRAY_BUFFER
  • GL_PIXEL_PACK_BUFFER (OpenGL 2.1 or newer hardware only)
  • GL_PIXEL_UNPACK_BUFFER (OpenGL 2.1 or newer hardware only)
  • GL_TEXTURE_BUFFER (OpenGL 3.2 or newer hardware only)
  • GL_UNIFORM_BUFFER (OpenGL 3.2 or newer hardware only)

Returns true if the given target was one of the targets tracked by this state tracker, false otherwise.

◆ bindFramebuffer()

void TSLOpenGLStateTracker::bindFramebuffer ( GLenum target,
GLuint framebuffer )

Bind a framebuffer object.

This function is equivalent to: glBindFramebuffer( target, framebuffer )

◆ bindTexture()

void TSLOpenGLStateTracker::bindTexture ( GLenum textureUnit,
GLenum target,
GLuint texture )

This function is equivalent to:

glActiveTexture( textureUnit ) glTexture( target, texture )

◆ bindVertexArrayObject()

GLuint TSLOpenGLStateTracker::bindVertexArrayObject ( GLuint vao)

This function is equivalent to the following for OpenGL 3.0 and newer hardware:

GLuint originalVAO; glGetIntegerv( GL_VERTEX_ARRAY_BINDING, &originalVAO ); glBindVertexArray( vao ); return originalVAO;

Unlike other state tracker functions the drawing surface will not automatically rebind VAOs as need when control is returned to MapLink from user drawing code. If applications change the currently bound VAO then they should manually rebind the VAO returned from the first call to this method.

◆ blendFunc()

void TSLOpenGLStateTracker::blendFunc ( GLenum sfactor,
GLenum dfactor )

This function is equivalent to glBlendFunc(sfactor, dfactor).

MapLink uses a default of glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA).

◆ deleteFramebuffer()

void TSLOpenGLStateTracker::deleteFramebuffer ( GLuint framebuffer)

Delete a framebuffer object.

This function is equivalent to: glDeleteFramebuffers( 1, &framebuffer )

◆ depthFunction()

void TSLOpenGLStateTracker::depthFunction ( GLenum func)

This function is equivalent to:

glDepthFunc( func )

◆ disableBlending()

void TSLOpenGLStateTracker::disableBlending ( )

This function is equivalent to:

glDisable( GL_BLEND )

◆ disableDepthTest()

void TSLOpenGLStateTracker::disableDepthTest ( )

This function is equivalent to:

glDisable( GL_DEPTH_TEST )

◆ disableMultisample()

void TSLOpenGLStateTracker::disableMultisample ( )

This function is equivalent to:

glDisable( GL_MULTISAMPLE )

This function has no effect on OpenGL ES 2.0 hardware.

◆ disablePointSprites()

void TSLOpenGLStateTracker::disablePointSprites ( )

This function is equivalent to the following for OpenGL 3.2 and newer hardware:

glDisable( GL_PROGRAM_POINT_SIZE )

This function is equivalent to the following for OpenGL 3.1 and older hardware:

glDisable( GL_VERTEX_PROGRAM_POINT_SIZE )

This function has no effect on OpenGL ES 2.0 hardware.

◆ disablePrimitiveRestart()

void TSLOpenGLStateTracker::disablePrimitiveRestart ( )

This function is equivalent to the following for OpenGL 3.1 and newer hardware:

glDisable( GL_PRIMITIVE_RESTART )

This function has no effect on OpenGL 3.0 and older or ES 2.0 hardware.

◆ disableVertexAttribArray()

void TSLOpenGLStateTracker::disableVertexAttribArray ( GLuint index)

This function is equivalent to:

glDisableVertexAttribArray( index )

◆ enableBlending()

void TSLOpenGLStateTracker::enableBlending ( )

This function is equivalent to:

glEnable( GL_BLEND )

◆ enableDepthTest()

void TSLOpenGLStateTracker::enableDepthTest ( )

This function is equivalent to:

glEnable( GL_DEPTH_TEST )

◆ enableMultisample()

void TSLOpenGLStateTracker::enableMultisample ( )

This function is equivalent to:

glEnable( GL_MULTISAMPLE )

This function has no effect on OpenGL ES 2.0 hardware.

◆ enablePointSprites()

void TSLOpenGLStateTracker::enablePointSprites ( )

This function is equivalent to the following for OpenGL 3.2 and newer hardware:

glEnable( GL_PROGRAM_POINT_SIZE )

This function is equivalent to the following for OpenGL 3.1 and older hardware:

glEnable( GL_VERTEX_PROGRAM_POINT_SIZE )

This function has no effect on OpenGL ES 2.0 hardware.

◆ enablePrimitiveRestart()

void TSLOpenGLStateTracker::enablePrimitiveRestart ( )

This function is equivalent to the following for OpenGL 3.1 and newer hardware:

glEnable( GL_PRIMITIVE_RESTART )

This function has no effect on OpenGL 3.0 and older or ES 2.0 hardware.

◆ enableVertexAttribArray()

void TSLOpenGLStateTracker::enableVertexAttribArray ( GLuint index)

This function is equivalent to:

glEnableVertexAttribArray( index )

◆ primitiveRestartIndex()

void TSLOpenGLStateTracker::primitiveRestartIndex ( GLuint index)

This function is equivalent to the following for OpenGL 3.1 and newer hardware:

glPrimitiveRestartIndex( index )

This function has no effect on OpenGL 3.0 and older or ES 2.0 hardware.

◆ reset()

void TSLOpenGLStateTracker::reset ( )

Causes the state tracker to re-read all tracked state values from OpenGL. This can be used to ensure the state tracker has the correct values for the OpenGL state after it has been modified outside of MapLink.

Applications should try to avoid calling this function during drawing as it will generally cause the driver to block the application until all pending OpenGL calls are complete and thus is an expensive operation.

◆ resetDefault()

void TSLOpenGLStateTracker::resetDefault ( )

TODO - this method has not been implemented.

◆ resetTextures()

void TSLOpenGLStateTracker::resetTextures ( )

TODO - this method has not been implemented.

◆ useProgram()

void TSLOpenGLStateTracker::useProgram ( GLuint program)

This function is equivalent to:

glUseProgram( program )

◆ vertexAttribPointer()

void TSLOpenGLStateTracker::vertexAttribPointer ( GLuint buffer,
GLuint index,
GLint size,
GLenum type,
GLboolean normalized,
GLsizei stride,
const GLvoid * pointer )

This function is equivalent to:

glBindBuffer( GL_ARRAY_BUFFER, buffer ); glVertexAttribPointer( index, size, type, normalized, stride, pointer );