the Fiddler's picture

GLPlusPlus C++ OpenGL headers

GLPlusPlus is a C++ version of gl.h and glext.h. It is simple, fast and portable.

Features

  • Proper C++ namespaces
  • Proper enumerations for function parameters
  • Overloads for related functions (Vertex3 instead of glVertex3fuiv)
  • Automatic extension loading
  • Enhanced debugging capabilities
  • Support for forward-compatible OpenGL 3.3 and 4.1
  • Support for backwards-compatible OpenGL 2.1 (enable with -DALLOW_COMPATIBLE_GL)

Usage

#include "gl++"
#include <vector>
 
using namespace OpenTK;
 
void gl4()
{
    std::vector<const char*> source;
    source.push_back("void main() { }");
 
    GL::Init();
    int shader = GL::CreateShader(ShaderType::VertexShader);
    GL::ShaderSource(shader, source.size(), &source[0], NULL);
    GL::CompileShader(shader);
}
 
void gl2()
{
    // Enable with -DGLPP_COMPATIBLE
    GL::Init();
    GL::Begin(BeginMode.Triangles);
        GL::Vertex2(-1.0f, -1.0f);
        GL::Vertex2(1.0f, -1.0f);
        GL::Vertex2(0.0f, 1.0f);
    GL::End();
}

GLPlusPlus is built using the OpenTK binding generator.

Releases

Official releasesDateSizeLinksStatus
2010.12.072010-Dec-07411 bytesRecommended for 1.xThis is currently the recommended release for 1.x.