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

# osg::GraphicsThread Class Reference

GraphicsThread is a helper class for running OpenGL GraphicsOperation within a single thread assigned to a specific GraphicsContext. More...

Inheritance diagram for osg::GraphicsThread:

[legend]
List of all members.

## Public Member Functions
| GraphicsThread ()
void | add (Operation *operation, bool waitForCompletion=false)
| Add operation to end of OperationQueue, this will be executed by the graphics thread once this operation gets to the head of the queue.
void | remove (Operation *operation)
| Remove operation from OperationQueue.
void | remove (const std::string &name)
| Remove named operation from OperationQueue.
void | removeAllOperations ()
| Remove all operations from OperationQueue.
osg::ref_ptr< Operation > | getCurrentOperation ()
| Get the operation currently being run.
virtual void | run ()
| Run does the graphics thread run loop.
void | setDone (bool done)
bool | getDone () const
virtual int | cancel ()
| Cancel this graphics thread.
## Protected Types
typedef std::list< ref_ptr< Operation > > | OperationQueue
## Protected Member Functions
virtual | ~GraphicsThread ()
## Protected Attributes
GraphicsContext * | _graphicsContext
bool | _done
OpenThreads::Mutex | _operationsMutex
osg::ref_ptr< osg::Block > | _operationsBlock
OperationQueue | _operations
osg::ref_ptr< Operation > | _currentOperation

## Detailed Description

GraphicsThread is a helper class for running OpenGL GraphicsOperation within a single thread assigned to a specific GraphicsContext.

## Member Typedef Documentation

typedef std::list< ref_ptr<Operation> > osg::GraphicsThread::OperationQueue`[protected]`

## Constructor & Destructor Documentation

osg::GraphicsThread::GraphicsThread | ( |  | ) |

virtual osg::GraphicsThread::~GraphicsThread | ( |  | ) | `[protected, virtual]`

## Member Function Documentation

void osg::GraphicsThread::add | ( | Operation * | operation,
|  | bool | waitForCompletion = false
| ) |

| Add operation to end of OperationQueue, this will be executed by the graphics thread once this operation gets to the head of the queue.

virtual int osg::GraphicsThread::cancel | ( |  | ) | `[virtual]`

| Cancel this graphics thread.

osg::ref_ptr<Operation> osg::GraphicsThread::getCurrentOperation | ( |  | ) | `[inline]`

| Get the operation currently being run.

bool osg::GraphicsThread::getDone | ( |  | ) | const`[inline]`

void osg::GraphicsThread::remove | ( | const std::string & | name | ) |

| Remove named operation from OperationQueue.

void osg::GraphicsThread::remove | ( | Operation * | operation | ) |

| Remove operation from OperationQueue.

void osg::GraphicsThread::removeAllOperations | ( |  | ) |

| Remove all operations from OperationQueue.

virtual void osg::GraphicsThread::run | ( |  | ) | `[virtual]`

| Run does the graphics thread run loop.

void osg::GraphicsThread::setDone | ( | bool | done | ) |

## Member Data Documentation

osg::ref_ptr<Operation> osg::GraphicsThread::_currentOperation`[protected]`

bool osg::GraphicsThread::_done`[protected]`

GraphicsContext* osg::GraphicsThread::_graphicsContext`[protected]`

OperationQueue osg::GraphicsThread::_operations`[protected]`

osg::ref_ptr<osg::Block> osg::GraphicsThread::_operationsBlock`[protected]`

OpenThreads::Mutex osg::GraphicsThread::_operationsMutex`[protected]`

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

- GraphicsThread