Skip to content
Overv edited this page Jul 15, 2012 · 2 revisions

This article describes how your application can be extended with OpenGL C API features not currently wrapped in OOGL.

Using OOGL classes in OpenGL calls

All OOGL classes that wrap OpenGL objects (VertexBuffer, VertexArray, Texture, ...) can be implicitly cast back to the underlying GLuint object name. This is demonstrated in a sample below.

GL::Image image( "/path/to/image.png" );
GL::Tex tex( image );

glBindTexture( GL_TEXTURE_2D, tex );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE );

tex.SetFilters( Filter::LinearMipmapLinear, Filter::LinearMipmapLinear );

As long as you don't destroy an object, OOGL and OpenGL calls can always be interchanged.

Clone this wiki locally