rGLuintObject Class Reference

safe wrapper for GL objects classifed by GLuints (textures, render buffers) More...

#include <rGLuintObject.h>

Inheritance diagram for rGLuintObject:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 rGLuintObject ()
 default constructor
 operator GLuint ()
 implicit conversion to GLuints, auto-creating the object
bool IsValid () const
 checks whether the object is valid
virtual ~rGLuintObject ()
 NOTE: the destructor of a derived class needs to call Delete() itself.
void Gen ()
 reserve the object
void Delete ()
 free the object

Protected Member Functions

 rGLuintObject (rGLuintObject const &)
 forbidden copy construcor
rGLuintObjectoperator= (rGLuintObject const &)

Protected Attributes

GLuint object_
 forbidden copy operator

Private Member Functions

virtual void DoGen ()=0
 really reserves the object
virtual void DoDelete ()=0
 really frees the object


Detailed Description

safe wrapper for GL objects classifed by GLuints (textures, render buffers)

Definition at line 35 of file rGLuintObject.h.


Constructor & Destructor Documentation

rGLuintObject::rGLuintObject (  ) 

default constructor

Definition at line 32 of file rGLuintObject.cpp.

00033         : object_(0)
00034 {
00035 }

rGLuintObject::~rGLuintObject (  )  [virtual]

NOTE: the destructor of a derived class needs to call Delete() itself.

Definition at line 51 of file rGLuintObject.cpp.

00052 {
00053 }

rGLuintObject::rGLuintObject ( rGLuintObject const &   )  [protected]

forbidden copy construcor


Member Function Documentation

rGLuintObject::operator GLuint (  ) 

implicit conversion to GLuints, auto-creating the object

Returns:
the GLUint representing the object, always guaranteed to be valid

Definition at line 38 of file rGLuintObject.cpp.

References Gen(), and object_.

00039 {
00040     // auto-generate the object
00041     Gen();
00042     return object_;
00043 }

Here is the call graph for this function:

bool rGLuintObject::IsValid (  )  const

checks whether the object is valid

Returns:
true if the object is currently valid (meaning: Gen() has been called after Delete())

Definition at line 46 of file rGLuintObject.cpp.

References object_.

00047 {
00048     return object_;
00049 }

void rGLuintObject::Gen (  ) 

reserve the object

Definition at line 55 of file rGLuintObject.cpp.

References DoGen(), object_, and sr_CheckGLError().

Referenced by operator GLuint().

00056 {
00057     if ( !object_ )
00058     {
00059         sr_CheckGLError();
00060         DoGen();
00061         sr_CheckGLError();
00062     }
00063 }

Here is the call graph for this function:

Here is the caller graph for this function:

void rGLuintObject::Delete (  ) 

free the object

Definition at line 65 of file rGLuintObject.cpp.

References DoDelete(), object_, and sr_CheckGLError().

Referenced by rGluintObjectDummy::~rGluintObjectDummy().

00066 {
00067     if ( object_ )
00068     {
00069         sr_CheckGLError();
00070         DoDelete();
00071         sr_CheckGLError();
00072     }
00073     object_ = 0;
00074 }

Here is the call graph for this function:

Here is the caller graph for this function:

rGLuintObject& rGLuintObject::operator= ( rGLuintObject const &   )  [protected]

virtual void rGLuintObject::DoGen (  )  [private, pure virtual]

really reserves the object

Implemented in rGluintObjectDummy.

Referenced by Gen().

Here is the caller graph for this function:

virtual void rGLuintObject::DoDelete (  )  [private, pure virtual]

really frees the object

Implemented in rGluintObjectDummy.

Referenced by Delete().

Here is the caller graph for this function:


Member Data Documentation

GLuint rGLuintObject::object_ [protected]

forbidden copy operator

the wrapped "object"

Definition at line 51 of file rGLuintObject.h.

Referenced by Delete(), Gen(), IsValid(), and operator GLuint().


The documentation for this class was generated from the following files:
Generated on Sat Mar 15 23:52:42 2008 for Armagetron Advanced by  doxygen 1.5.4