SenOGL  0.2
Library aiming to ease the use of OpenGL
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Public Member Functions | Protected Attributes | List of all members
OpenGLObject Class Referenceabstract

Base class for every OpenGL Object. More...

#include <OpenGLObject.hpp>

Inheritance diagram for OpenGLObject:
Buffer Framebuffer< TexType, ColorCount, DepthType, UseDepth > Program ProgramPipeline Query Renderbuffer Sampler Shader Texture TransformFeedback VertexArray

Classes

class  Binder
 Generic Binder Does nothing at this stage. More...
 

Public Member Functions

 OpenGLObject ()
 
 OpenGLObject (GLuint handle)
 Constructs a instance managing an existing OpenGL Object. More...
 
 OpenGLObject (const OpenGLObject &)=default
 
 OpenGLObject (OpenGLObject &&)=default
 
OpenGLObjectoperator= (const OpenGLObject &)=default
 
OpenGLObjectoperator= (OpenGLObject &&)=default
 
virtual ~OpenGLObject ()
 
virtual void init ()=0
 Generates a OpenGL object name to manage. More...
 
virtual void cleanup ()=0
 Deletes the managed OpenGL object. More...
 
GLuint getName () const
 Returns OpenGL name of the object. More...
 
void setName (GLuint n)
 Sets the OpenGL name of the object managed by this instance /!\ Use with caution ! (assignment operator is probably what you're looking for) More...
 
virtual bool isValid () const
 Returns true if the object seems valid. More...
 
 operator bool () const
 Syntactic sugar for isValid(). More...
 

Protected Attributes

GLuint _handle
 OpenGL name of the managed object. More...
 

Detailed Description

Base class for every OpenGL Object.

Constructor & Destructor Documentation

OpenGLObject::OpenGLObject ( )
OpenGLObject::OpenGLObject ( GLuint  handle)

Constructs a instance managing an existing OpenGL Object.

(Copy-constructor is generally a better option)

Parameters
handleObject to manage.
OpenGLObject::OpenGLObject ( const OpenGLObject )
default
OpenGLObject::OpenGLObject ( OpenGLObject &&  )
default
OpenGLObject::~OpenGLObject ( )
virtual

Member Function Documentation

virtual void OpenGLObject::cleanup ( )
pure virtual
GLuint OpenGLObject::getName ( ) const
inline

Returns OpenGL name of the object.

virtual void OpenGLObject::init ( )
pure virtual
virtual bool OpenGLObject::isValid ( ) const
inlinevirtual

Returns true if the object seems valid.

Can be overloaded for concrete types if there is other attributes to test.

Reimplemented in Texture, Program, Sampler, Shader, and Renderbuffer.

OpenGLObject::operator bool ( ) const
inline

Syntactic sugar for isValid().

Allow the use of quick tests :

if(OpenGLObject_Instance) { ... }
OpenGLObject& OpenGLObject::operator= ( const OpenGLObject )
default
OpenGLObject& OpenGLObject::operator= ( OpenGLObject &&  )
default
void OpenGLObject::setName ( GLuint  n)
inline

Sets the OpenGL name of the object managed by this instance /!\ Use with caution ! (assignment operator is probably what you're looking for)

Parameters
nNew object to manage.

Member Data Documentation

GLuint OpenGLObject::_handle
protected

OpenGL name of the managed object.


The documentation for this class was generated from the following files: