GLS
1.0.0
GL Stuff - A library aimed at reducing the boilerplate OpenGL code you always have to write.
|
A RAII wrapper around any OpenGL object. More...
#include <object.hpp>
Public Member Functions | |
object () | |
Default constructor. More... | |
~object () | |
Default destructor. More... | |
object (object &&other) | |
Move constructor. More... | |
object & | operator= (object &&other) |
Move assignment. More... | |
GLuint | name () const |
Retrieve the OpenGL name of this buffer. More... | |
A RAII wrapper around any OpenGL object.
A gls::object is a simple wrapper object any type of OpenGL object that has functions to generate and delete names.
Generator | void(GLsizei, GLuint*) function that generates the name |
Deleter | void(GLsizei, const GLuint*) function that deletes the name |
The object name is generated when the gls::object is constructed and deleted when it is destroyed. It be retrieved with name().
gls::object and all the other GLS classes that use it are move-only.
The generator template parameter has the signature: void(GLsizei, GLuint*) and the deleter template parameter has the signature: void(GLsizei, const GLuint*)
Note: gls::object takes as its template parameters function pointers with the default calling convention for your compiler/architecture. If you want to call functions with differing calling conventions, you will have to wrap those in your own free functions which you can pass to gls::object.
Example usage:
object | ( | ) |
Default constructor.
~object | ( | ) |
Default destructor.
Move constructor.
other | Other object that is being moved from |
Move assignment.
other | Other object that is being assigned from |
GLuint name | ( | ) | const |
Retrieve the OpenGL name of this buffer.