# Visualization Library A lightweight C++ OpenGL middleware for 2D/3D graphics | [Home] [Tutorials] [All Classes] [Grouped Classes]

# OpenGL vs VL function mapping

The table below shows how the most important OpenGL features and functions map to Visualization Library classes and functions.

OpenGL functions | Visualization Library classes and functions
--- | ---
Texturing
glActiveTexture() glClientActiveTexture() glBindTexture() glTexImage1D() glTexImage2D() glTexImage3D() glCompressedTexImage1D() glCompressedTexImage2D() glCompressedTexImage3D() glGenTextures() glDeleteTextures() | vl::Texture vl::Texture::setupTexture1D() vl::Texture::setupTexture2D() vl::Texture::setupTexture3D() vl::Texture::setupTextureCubemap() vl::Texture::setupTextureRectangle() vl::Texture::setupTexture1DArray() vl::Texture::setupTexture2DArray() vl::TextureUnit vl::Shader::gocTextureUnit()
gluBuild1DMipmaps() gluBuild2DMipmaps() gluBuild3DMipmaps() | Mipmaps are automatically generated when requested by the texture constructor or by one of the vl::Texture::setupTexture*() methods. The texture generation uses the hardware acceleration where available otherwise glu is used.
glTexSubImage1D() glTexSubImage2D() glTexSubImage3D() glCompressedTexSubImage1D() glCompressedTexSubImage2D() glCompressedTexSubImage3D() | Not mapped, you can use them like this:
    vl::Texture* texture = ... init texture ...
    glBindTexture(GL_TEXTURE_2D, texture->handle());
    glTexSubImage2D(GL_TEXTURE_2D, ...);
glTexParameter() | vl::TexParameter vl::Texture::getTexParameter()
glTexGen() | vl::TexGen vl::Shader::gocTexGen(), vl::Shader::getTexGen()
glTexEnv() | vl::TexEnv vl::Shader::gocTexEnv(), vl::Shader::getTexEnv()
glClientActiveTexture() glTexCoord() glMultiTexCoord() glTexCoordPointer() | vl::Geometry::setTexCoordArray()
glCopyTexImage1D() glCopyTexImage2D() glCopyTexSubImage1D() glCopyTexSubImage2D() glCopyTexSubImage3D() | vl::CopyTexSubImage1D vl::CopyTexSubImage2D vl::CopyTexSubImage3D
Matrices
glMatrixMode() glLoadMatrix() glLoadIdentity() glMultMatrix() glPushMatrix() glPopMatrix() glTranslate() glScale() glRotate() | vl::dmat4 vl::fmat4 vl::TextureMatrix vl::Transform vl::Billboard vl::Camera vl::Camera::setViewMatrix() vl::Camera::setProjectionMatrix()
Camera viewing and projection matrices
gluPerspective() glFrustum() glOrtho() gluOrtho2D() gluLookAt() gluProject() gluUnProject() | vl::dmat4::perspective() vl::dmat4::frustum() vl::dmat4::ortho() vl::dmat4::lookAt() vl::Camera::setProjectionAsPerspective() vl::Camera::setProjectionAsFrustum() vl::Camera::setProjectionAsOrtho() vl::Camera::setProjectionAsOrtho2D() vl::Camera::setViewMatrixAsLookAt() vl::Camera::project() vl::Camera::unproject()
Vertex attributes
glVertex() glVertexPointer() | vl::Geometry::setVertexArray()
glVertexAttrib() glVertexAttribPointer() | vl::Geometry::setVertexAttributeArray()
glNormal() glNormalPointer() | vl::Geometry::setNormalArray()
glColor() glColorPointer() | vl::Geometry::setColorArray()
glSecondaryColor() glSecondaryColorPointer() | vl::Geometry::setSecondaryColorArray()
glFogCoord() glFogCoordPointer() | vl::Geometry::setFogCoordArray()
Draw commands
glDrawArrays() glMultiDrawArrays() glDrawArraysInstanced() | vl::DrawArrays vl::Geometry::primitives()
glDrawElements() glMultiDrawElements() glDrawArraysInstanced() | vl::DrawElements vl::Geometry::primitives()
Enables
glEnable() glDisable() glIsEnabled() | vl::Shader::enable() vl::Shader::disable() vl::Shader::isEnabled()
glReadPixels
glReadPixels() | vl::Image::readPixels() vl::ReadPixels
OpenGL Shading Language
glCreateShader(), glDeleteShader() glCreateProgram(), glDeleteProgram() glLinkProgram() glAttachShader() glDetachShader() glCompileShader() glUseProgram() glValidateProgram() glBindAttribLocation() glUniform() | vl::GLSLVertexShader, vl::GLSLFragmentShader, vl::GLSLGeometryShader vl::GLSLProgram vl::GLSLProgram::linkProgram() (done automatically) vl::GLSLProgram::attachShader() vl::GLSLProgram::detachShader() (done automatically) vl::GLSLProgram::useProgram() vl::GLSLProgram::validateProgram() vl::GLSLProgram::bindAttribLocation() vl::Uniform, vl::GLSLProgram::setUniform(), vl::Actor::setUniform(), vl::Shader::setUniform()
Vertex and pixel buffer objects (VBO, PBO)
glGenBuffers() glDeleteBuffers() glBufferData() glBufferSubData() glMapBuffer() glUnmapBuffer() | vl::GLBufferObject vl::GLBufferObject::createGLBufferObject() vl::GLBufferObject::deleteGLBufferObject() vl::GLBufferObject::setBufferData() vl::GLBufferObject::setBufferSubData() vl::GLBufferObject::mapGPUBuffer() vl::GLBufferObject::unmapGPUBuffer() vl::Geometry::setVBOEnabled() vl::Image::readPixels() vl::DrawPixels
Framebuffer object extension
See http://oss.sgi.com/projects/ogl-sample/registry/EXT/framebuffer_object.txt glFramebufferTexture1D() glFramebufferTexture2D() glFramebufferTexture() glFramebufferTexture3D() glFramebufferTextureLayer() glCheckFramebufferStatus() glGenRenderbuffers() glDeleteRenderbuffers() glRenderbufferStorage() glFramebufferRenderbuffer() glGenFramebuffers() glDeleteFramebuffers() glBindFramebuffer() | vl::FBOTexture1DAttachment vl::FBOTexture2DAttachment vl::FBOTextureAttachment vl::FBOTexture3DAttachment vl::FBOTextureLayerAttachment vl::FBORenderTarget::checkFramebufferStatus() vl::FBORenderbufferAttachment::create() vl::FBORenderbufferAttachment::destroy() automatically called inside vl::FBOAttachmentAbstract::bindAttachment() automatically called inside vl::FBOAttachmentAbstract::bindAttachment() vl::FBORenderTarget::create() vl::FBORenderTarget::destroy() vl::FBORenderTarget::bindFrameBuffer() (initializes also the attachment points)
Display lists
glGenLists() glDeleteLists() glNewList() glCallLists() glCallList() | vl::Renderable::setDisplayListEnabled() vl::Renderable::setDisplayListDirty() vl::Renderable::displayList() vl::Renderable::deleteDisplayList()
Render states
glAlphaFunc glBlendColor glBlendEquation glBlendFunc glClipPlane glColorMask glCullFace glDepthFunc glDepthMask glDepthRange glFog glFrontFace glHint glLight glLightModel glLineStipple glLineWidth glLogicOp glMaterial glPixelTransfer glPointParameter glPointSize glPolygonMode glPolygonOffset glPolygonStipple glSampleCoverage glShadeModel glStencilFunc glStencilMask glStencilOp glTexEnv glTexGen | vl::AlphaFunc vl::BlendColor vl::BlendEquation vl::BlendFunc vl::ClipPlane vl::ColorMask vl::CullFace vl::DepthFunc vl::DepthMask vl::DepthRange vl::Fog vl::FrontFace vl::Hint vl::Light vl::LightModel vl::LineStipple vl::LineWidth vl::LogicOp vl::Material vl::PixelTransfer vl::PointParameter vl::PointSize vl::PolygonMode vl::PolygonOffset vl::PolygonStipple vl::SampleCoverage vl::ShadeModel vl::StencilFunc vl::StencilMask vl::StencilOp vl::TexEnv vl::TexGen
OpenGL Enables
GL_ALPHA_TEST GL_BLEND GL_COLOR_LOGIC_OP GL_LIGHTING GL_COLOR_SUM GL_CULL_FACE GL_DEPTH_TEST GL_FOG GL_LINE_SMOOTH GL_LINE_STIPPLE GL_POLYGON_STIPPLE GL_NORMALIZE GL_POINT_SMOOTH GL_POINT_SPRITE GL_POLYGON_SMOOTH GL_POLYGON_OFFSET_FILL GL_POLYGON_OFFSET_LINE GL_POLYGON_OFFSET_POINT GL_RESCALE_NORMAL GL_STENCIL_TEST GL_VERTEX_PROGRAM_POINT_SIZE GL_VERTEX_PROGRAM_TWO_SIDE GL_MULTISAMPLE GL_SAMPLE_ALPHA_TO_COVERAGE GL_SAMPLE_ALPHA_TO_ONE GL_SAMPLE_COVERAGE GL_LIGHTi GL_CLIP_PLANEi GL_SCISSOR_TEST GL_COLOR_MATERIAL GL_TEXTURE_1D GL_TEXTURE_2D GL_TEXTURE_3D GL_TEXTURE_CUBE_MAP GL_TEXTURE_GEN_Q/R/S/T GL_DITHER GL_INDEX_LOGIC_OP | vl::EN_ALPHA_TEST vl::EN_BLEND vl::EN_COLOR_LOGIC_OP vl::EN_LIGHTING vl::EN_COLOR_SUM vl::EN_CULL_FACE vl::EN_DEPTH_TEST vl::EN_FOG vl::EN_LINE_SMOOTH vl::EN_LINE_STIPPLE vl::EN_POLYGON_STIPPLE vl::EN_NORMALIZE vl::EN_POINT_SMOOTH vl::EN_POINT_SPRITE vl::EN_POLYGON_SMOOTH vl::EN_POLYGON_OFFSET_FILL vl::EN_POLYGON_OFFSET_LINE vl::EN_POLYGON_OFFSET_POINT vl::EN_RESCALE_NORMAL vl::EN_STENCIL_TEST vl::EN_VERTEX_PROGRAM_POINT_SIZE vl::EN_VERTEX_PROGRAM_TWO_SIDE vl::EN_MULTISAMPLE vl::EN_SAMPLE_ALPHA_TO_COVERAGE vl::EN_SAMPLE_ALPHA_TO_ONE vl::EN_SAMPLE_COVERAGE automatically managed by vl::Light automatically managed by vl::ClipPlane automatically manaded by vl::Scissor see vl::Material::setColorMaterial(), vl::Material::setColorMaterialEnabled() automatically managed, see vl::Texture, vl::TextureUnit, vl::TexParameter automatically managed, see vl::Texture, vl::TextureUnit, vl::TexParameter automatically managed, see vl::Texture, vl::TextureUnit, vl::TexParameter automatically managed, see vl::Texture, vl::TextureUnit, vl::TexParameter automatically managed by vl::TexGen deprecated functionality deprecated functionality

Visualization Library v2009.08 Reference Documentation
Copyright 2005-2009 Michele Bosi. All rights reserved.
Updated on Sun Nov 8 14:28:54 2009.
Permission is granted to use this page to write and publish articles regarding Visualization Library.