NGL
6.5
The NCCA Graphics Library
|
extensible factory to allow different types of VAO's to be generated for NGL two default ones will be created but allows the user to do more complex stuff if required More...
#include <VAOFactory.h>
Static Public Member Functions | |
static void | registerVAOCreator (const std::string &_type, std::function< AbstractVAO *(GLenum _mode)> _cb) |
Add a new vao creator to our factory. More... | |
static void | unregisterVAOCreator (const std::string &_type) |
Remove an existing vao creator from the map. More... | |
static AbstractVAO * | createVAO (const std::string &_type, GLenum _mode=GL_TRIANGLES) |
static void | listCreators () |
debug function to list all creators More... | |
Static Private Attributes | |
static std::unordered_map< std::string, std::function< AbstractVAO *(GLenum _mode)> > | m_vaoCreators |
extensible factory to allow different types of VAO's to be generated for NGL two default ones will be created but allows the user to do more complex stuff if required
Definition at line 39 of file VAOFactory.h.
|
static |
Create an instance of a named VAO from a creator
_type | the name of the creator to use from our factory |
_mode | the initial mode to create (i.e. GL_TRIANGLES etc) |
Definition at line 19 of file VAOFactory.cpp.
References m_vaoCreators.
|
static |
debug function to list all creators
Definition at line 32 of file VAOFactory.cpp.
References m_vaoCreators.
|
static |
Add a new vao creator to our factory.
_type | the name of the creator function registered |
_cb | the creator function must pass in a GLenum for the type to create and return an AbstractVAO |
Definition at line 9 of file VAOFactory.cpp.
References m_vaoCreators.
|
static |
Remove an existing vao creator from the map.
_type | the name of the creator to remove |
Definition at line 14 of file VAOFactory.cpp.
References m_vaoCreators.
|
staticprivate |
Definition at line 67 of file VAOFactory.h.