PrevUpHomeNext

Object creation methods

#include <oglplus/wrapper.hpp>

OpenGL supports two kinds of object creation functions:

  1. The glGen* functions, which just generate a new object name, but don't have to actually initialize the actual GL object. The construction is usually postponed until the call to glBind*.
  2. The glCreate* functions, which both generate a name and initialize the new object.

Prior to GL version 4.5 some objects like Texture, Buffer, Query etc. were created just by using the glGen* functions and some objects like Program and Shader just by the glCreate* functions. Since GL version 4.5 it is possible to choose the construction method for several types of objects (for example to create a new buffer either the glGenBuffers or glCreateBuffers function can be used.

OGLplus distinguishes the object construction methods as listed above at compile-time by using the following tag types:

namespace tag {

struct Generate; 1
struct Create ; 2

} // namespace tag

1

Indicates that a glGen* function should be used.

2

Indicates that a glCreate* function should be used.


PrevUpHomeNext