Renamed include/osg/OperationsThread to OperationThread.
Created a new GraphicsThread subclass from OperationThread which allows the GraphicsContext specific calls to be moved out of the base OperationThread class. Updated the rest of the OSG to respect these changes.
This commit is contained in:
@@ -19,6 +19,28 @@
|
||||
using namespace osg;
|
||||
using namespace OpenThreads;
|
||||
|
||||
GraphicsThread::GraphicsThread()
|
||||
{
|
||||
}
|
||||
|
||||
void GraphicsThread::run()
|
||||
{
|
||||
// make the graphics context current.
|
||||
GraphicsContext* graphicsContext = dynamic_cast<GraphicsContext*>(_parent.get());
|
||||
if (graphicsContext)
|
||||
{
|
||||
graphicsContext->makeCurrent();
|
||||
}
|
||||
|
||||
OperationThread::run();
|
||||
|
||||
if (graphicsContext)
|
||||
{
|
||||
graphicsContext->releaseContext();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
struct BlockOperation : public Operation, public Block
|
||||
{
|
||||
BlockOperation():
|
||||
|
||||
Reference in New Issue
Block a user