Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

osg::Window::GLObject Class Reference
[Window]

#include <OSGWindow.h>

List of all members.

Public Member Functions

 GLObject (GLObjectFunctor funct)
GLObjectFunctorgetFunctor (void)
void setFunctor (GLObjectFunctor funct)
UInt32 getLastValidate (void)
void setLastValidate (UInt32 val)
UInt32 getRefCounter (void)
UInt32 incRefCounter (void)
UInt32 decRefCounter (void)

Protected Attributes

GLObjectFunctor _functor
volatile UInt32 _refCounter
UInt32 _lastValidate


Detailed Description

The GLObject class is used to keep track of the OpenGL objects registered with the system. See OpenGL Objects & Extension Handling for a description.

Definition at line 290 of file OSGWindow.h.


Constructor & Destructor Documentation

osg::Window::GLObject::GLObject GLObjectFunctor  funct  )  [inline]
 

Definition at line 222 of file OSGWindow.inl.

00222                                                        :
00223             _functor(funct),
00224             _refCounter(0),
00225             _lastValidate(0)
00226 {
00227 }


Member Function Documentation

Window::GLObjectFunctor & osg::Window::GLObject::getFunctor void   )  [inline]
 

Definition at line 229 of file OSGWindow.inl.

References _functor.

Referenced by osg::Window::validateGLObject().

00230 {
00231     return _functor;
00232 };

void osg::Window::GLObject::setFunctor GLObjectFunctor  funct  )  [inline]
 

Definition at line 234 of file OSGWindow.inl.

References _functor.

00235 {
00236     _functor = funct;
00237 };

UInt32 osg::Window::GLObject::getLastValidate void   )  [inline]
 

Definition at line 239 of file OSGWindow.inl.

References _lastValidate.

00240 {
00241     return _lastValidate;
00242 }

void osg::Window::GLObject::setLastValidate UInt32  val  )  [inline]
 

Definition at line 244 of file OSGWindow.inl.

References _lastValidate.

00245 {
00246     _lastValidate = val;
00247 }

UInt32 osg::Window::GLObject::getRefCounter void   )  [inline]
 

Definition at line 249 of file OSGWindow.inl.

References _refCounter.

Referenced by osg::Window::frameExit().

00250 {
00251     return _refCounter;
00252 }

UInt32 osg::Window::GLObject::incRefCounter void   )  [inline]
 

Definition at line 254 of file OSGWindow.inl.

References osg::Window::_GLObjectLock, _refCounter, osg::Lock::aquire(), osg::ThreadManager::getLock(), osg::Lock::release(), and osg::ThreadManager::the().

Referenced by osg::Window::validateGLObject().

00255 {
00256     UInt32 val;
00257 
00258     if ( ! _GLObjectLock )
00259     {
00260         _GLObjectLock = ThreadManager::the()->getLock(NULL);
00261     }
00262 
00263     _GLObjectLock->aquire();
00264     val = _refCounter = _refCounter + 1;
00265     _GLObjectLock->release();
00266 
00267     return val;
00268 }

UInt32 osg::Window::GLObject::decRefCounter void   )  [inline]
 

Definition at line 270 of file OSGWindow.inl.

References osg::Window::_GLObjectLock, _refCounter, osg::Lock::aquire(), osg::ThreadManager::getLock(), osg::Lock::release(), and osg::ThreadManager::the().

Referenced by osg::Window::onDestroy().

00271 {
00272     UInt32 val;
00273 
00274     if(! _GLObjectLock)
00275     {
00276         _GLObjectLock = ThreadManager::the()->getLock(NULL);
00277     }
00278 
00279     _GLObjectLock->aquire();
00280     if(_refCounter)
00281         val = _refCounter = _refCounter - 1;
00282     else
00283         val = 0;
00284     _GLObjectLock->release();
00285 
00286     return val;
00287 }


Member Data Documentation

GLObjectFunctor osg::Window::GLObject::_functor [protected]
 

Definition at line 306 of file OSGWindow.h.

Referenced by getFunctor(), and setFunctor().

volatile UInt32 osg::Window::GLObject::_refCounter [protected]
 

Definition at line 307 of file OSGWindow.h.

Referenced by decRefCounter(), getRefCounter(), and incRefCounter().

UInt32 osg::Window::GLObject::_lastValidate [protected]
 

Definition at line 308 of file OSGWindow.h.

Referenced by getLastValidate(), and setLastValidate().


The documentation for this class was generated from the following files:
Generated on Thu Aug 25 04:27:54 2005 for OpenSG by  doxygen 1.4.3