gKitGL
BufferManager.h
00001 
00002 #ifndef _GKBUFFER_MANAGER_H
00003 #define _GKBUFFER_MANAGER_H
00004 
00005 #include "GLManager.h"
00006 #include "GL/GLPlatform.h"
00007 #include "GL/TPBuffer.h"
00008 
00009 
00010 namespace gk {
00011 
00012 //! \ingroup openGL
00013 //@{
00014     
00015 //! gestion 'auto' des ressources openGL : pour les buffers.
00016 inline GLAttributeBuffer *createAttributeBuffer( const unsigned int count, const unsigned int size, const void *data= NULL, const GLenum usage= GL_STATIC_DRAW )
00017 {
00018     return GLManager<GLAttributeBuffer>::manager().insert(
00019         new GLAttributeBuffer(count, size, data, usage) );
00020 }
00021 
00022 //! gestion 'auto' des ressources openGL : pour les buffers.
00023 inline GLIndexBuffer *createIndexBuffer( const unsigned int count, const unsigned int size, const void *data= NULL, const GLenum usage= GL_STATIC_DRAW )
00024 {
00025     return GLManager<GLIndexBuffer>::manager().insert(
00026         new GLIndexBuffer(count, size, data, usage) );
00027 }
00028 
00029 //! gestion 'auto' des ressources openGL : pour les buffers.
00030 inline GLBuffer *createBuffer( const GLenum target, const unsigned int count, const unsigned int size, const void *data= NULL, const GLenum usage= GL_STATIC_DRAW )
00031 {
00032     return GLManager<GLBuffer>::manager().insert(
00033         new GLBuffer(target, count, size, data, usage) );
00034 }
00035 
00036 //! gestion 'auto' des ressources openGL : pour les vertex arrays.
00037 inline GLVertexArray *createVertexArray( )
00038 {
00039     return GLManager<GLVertexArray>::manager().insert(
00040         new GLVertexArray );
00041 }
00042 
00043 //@}
00044 
00045 }
00046 
00047 #endif
 All Classes Namespaces Functions Variables Typedefs Enumerator Friends