Ork, for
OpenGL Rendering Kernel, provides an
object-oriented C++ API on top of OpenGL. Using Ork can greatly simplify the implementation of OpenGL applications. For instance, suppose that you want to draw a mesh in an offscreen framebuffer, with a program that uses a texture. Assuming that these objects are already created, with the OpenGL API you need something like this:
glUseProgram(myProgram);glActiveTexture(GL_TEXTURE0 + myUnit); glBindTexture(GL_TEXTURE_2D, myTexture);glUniform1i(glGetUniformLocation(myProgram, "mySampler"), myUnit);glBindBuffer(GL_ARRAY_BUFFER, myVBO);glVertexAttribPointer(0, 4, GL_FLOAT, false, 16, 0);glEnableVertexAttribArray(0);glBindFramebuffer(GL_FRAMEBUFFER, myFramebuffer);glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
With the Ork API you simply need two steps (and the first one does not need to be repeated before each draw, unless you want a different texture for each draw):
myProgram->getUniformSampler("mySampler")->set(myTexture);myFramebuffer->draw(myProgram, *myMesh);
The Ork API fully covers the
OpenGL 3.3 core profile, and partially covers the OpenGL 4.0 and 4.1 core profile APIs (tesselation shaders are supported, but uniform subroutines, binary shaders and programs, pipeline objects, separable shaders, and multiple viewports are currently not supported). Ork has just been released as an Open Source project, under the
LGPL license.