OSG
3.4.0
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
osg_head
include
osg
GraphicsThread.h
Go to the documentation of this file.
1
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
2
*
3
* This library is open source and may be redistributed and/or modified under
4
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5
* (at your option) any later version. The full license is in LICENSE file
6
* included with this distribution, and on the openscenegraph.org website.
7
*
8
* This library is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* OpenSceneGraph Public License for more details.
12
*/
13
14
#ifndef OSG_GRAPHICSTHREAD
15
#define OSG_GRAPHICSTHREAD 1
16
17
#include <osg/OperationThread>
18
#include <osg/State>
19
20
namespace
osg
{
21
22
class
GraphicsContext;
23
25
class
OSG_EXPORT
GraphicsThread
:
public
osg::OperationThread
26
{
27
public
:
28
29
GraphicsThread
();
30
32
virtual
void
run();
33
};
34
35
struct
OSG_EXPORT
GraphicsOperation
:
public
Operation
36
{
37
GraphicsOperation
(
const
std::string& name,
bool
keep):
38
Operation
(name,keep) {}
39
42
virtual
void
operator () (
Object
*
object
);
43
44
virtual
void
operator () (
GraphicsContext
* context) = 0;
45
};
46
47
49
struct
OSG_EXPORT
SwapBuffersOperation
:
public
GraphicsOperation
50
{
51
SwapBuffersOperation
():
52
osg
::
Referenced
(true),
53
GraphicsOperation
(
"SwapBuffers"
,true) {}
54
55
virtual
void
operator () (
GraphicsContext
* context);
56
};
57
59
struct
OSG_EXPORT
BarrierOperation
:
public
Operation
,
public
OpenThreads::Barrier
60
{
61
enum
PreBlockOp
62
{
63
NO_OPERATION
,
64
GL_FLUSH
,
65
GL_FINISH
66
};
67
68
BarrierOperation
(
int
numThreads,
PreBlockOp
op=NO_OPERATION,
bool
keep=
true
):
69
osg
::
Referenced
(true),
70
Operation
(
"Barrier"
, keep),
71
OpenThreads
::Barrier(numThreads),
72
_preBlockOp(op) {}
73
74
virtual
void
release();
75
76
virtual
void
operator () (
Object
*
object
);
77
78
PreBlockOp
_preBlockOp
;
79
};
80
83
struct
OSG_EXPORT
ReleaseContext_Block_MakeCurrentOperation
:
public
GraphicsOperation
,
public
RefBlock
84
{
85
ReleaseContext_Block_MakeCurrentOperation
():
86
osg
::
Referenced
(true),
87
GraphicsOperation
(
"ReleaseContext_Block_MakeCurrent"
, false) {}
88
89
virtual
void
release();
90
91
virtual
void
operator () (
GraphicsContext
* context);
92
};
93
94
struct
OSG_EXPORT
BlockAndFlushOperation
:
public
GraphicsOperation
,
public
OpenThreads::Block
95
{
96
BlockAndFlushOperation
();
97
98
virtual
void
release();
99
100
virtual
void
operator () (
GraphicsContext
*);
101
};
102
103
104
struct
OSG_EXPORT
FlushDeletedGLObjectsOperation
:
public
GraphicsOperation
105
{
106
FlushDeletedGLObjectsOperation
(
double
availableTime,
bool
keep=
false
);
107
108
virtual
void
operator () (
GraphicsContext
*);
109
110
double
_availableTime
;
111
};
112
113
class
OSG_EXPORT
RunOperations
:
public
osg::GraphicsOperation
114
{
115
public
:
116
117
RunOperations
():
118
osg
::
GraphicsOperation
(
"RunOperation"
,true) {}
119
120
virtual
void
operator () (
osg::GraphicsContext
* context);
121
122
};
123
124
class
OSG_EXPORT
EndOfDynamicDrawBlock
:
public
OpenThreads::BlockCount
,
public
osg::State::DynamicObjectRenderingCompletedCallback
125
{
126
public
:
127
128
EndOfDynamicDrawBlock
(
unsigned
int
);
129
130
void
completed(
osg::State
* state);
131
132
protected
:
133
134
~EndOfDynamicDrawBlock
() {}
135
};
136
137
}
138
139
#endif
osg::BarrierOperation::BarrierOperation
BarrierOperation(int numThreads, PreBlockOp op=NO_OPERATION, bool keep=true)
Definition:
GraphicsThread.h:68
OSG_EXPORT
#define OSG_EXPORT
Definition:
Export.h:43
osg::EndOfDynamicDrawBlock::~EndOfDynamicDrawBlock
~EndOfDynamicDrawBlock()
Definition:
GraphicsThread.h:134
osg::GraphicsOperation::GraphicsOperation
GraphicsOperation(const std::string &name, bool keep)
Definition:
GraphicsThread.h:37
osg::RunOperations::RunOperations
RunOperations()
Definition:
GraphicsThread.h:117
osg::OperationThread
Definition:
OperationThread.h:157
osg::Referenced
Definition:
Referenced.h:42
osg::State::DynamicObjectRenderingCompletedCallback
Definition:
State.h:1416
osg::Object
Definition:
Object.h:56
osg::BarrierOperation::PreBlockOp
PreBlockOp
Definition:
GraphicsThread.h:61
osg::BarrierOperation::_preBlockOp
PreBlockOp _preBlockOp
Definition:
GraphicsThread.h:78
OpenThreads::BlockCount
Definition:
Block.h:100
osg::BarrierOperation::GL_FLUSH
Definition:
GraphicsThread.h:64
OpenThreads::Block
Definition:
Block.h:25
osg::RunOperations
Definition:
GraphicsThread.h:113
osg::FlushDeletedGLObjectsOperation
Definition:
GraphicsThread.h:104
osg::EndOfDynamicDrawBlock
Definition:
GraphicsThread.h:124
OpenThreads
Definition:
Atomic.h:42
osg::BarrierOperation::NO_OPERATION
Definition:
GraphicsThread.h:63
osg::State
Definition:
State.h:116
osg::RefBlock
Definition:
OperationThread.h:30
OpenThreads::Barrier
This class provides an object-oriented thread barrier interface.
Definition:
Barrier.h:37
osg::SwapBuffersOperation::SwapBuffersOperation
SwapBuffersOperation()
Definition:
GraphicsThread.h:51
osg::ReleaseContext_Block_MakeCurrentOperation::ReleaseContext_Block_MakeCurrentOperation
ReleaseContext_Block_MakeCurrentOperation()
Definition:
GraphicsThread.h:85
osg::BarrierOperation
Definition:
GraphicsThread.h:59
osg::BlockAndFlushOperation
Definition:
GraphicsThread.h:94
osg::FlushDeletedGLObjectsOperation::_availableTime
double _availableTime
Definition:
GraphicsThread.h:110
osg::GraphicsContext
Definition:
GraphicsContext.h:29
osg::GraphicsOperation
Definition:
GraphicsThread.h:35
osg::GraphicsThread
Definition:
GraphicsThread.h:25
osg
Definition:
AlphaFunc.h:19
osg::Operation
Definition:
OperationThread.h:50
osg::SwapBuffersOperation
Definition:
GraphicsThread.h:49
osg::ReleaseContext_Block_MakeCurrentOperation
Definition:
GraphicsThread.h:83
Generated on Tue Oct 4 2016 19:20:47 for OSG by
1.8.8