OSG  3.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 
26 {
27  public:
28 
30 
32  virtual void run();
33 };
34 
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 
50 {
52  osg::Referenced(true),
53  GraphicsOperation("SwapBuffers",true) {}
54 
55  virtual void operator () (GraphicsContext* context);
56 };
57 
60 {
62  {
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 
79 };
80 
84 {
86  osg::Referenced(true),
87  GraphicsOperation("ReleaseContext_Block_MakeCurrent", false) {}
88 
89  virtual void release();
90 
91  virtual void operator () (GraphicsContext* context);
92 };
93 
95 {
97 
98  virtual void release();
99 
100  virtual void operator () (GraphicsContext*);
101 };
102 
103 
105 {
106  FlushDeletedGLObjectsOperation(double availableTime, bool keep=false);
107 
108  virtual void operator () (GraphicsContext*);
109 
111 };
112 
114 {
115 public:
116 
118  osg::GraphicsOperation("RunOperation",true) {}
119 
120  virtual void operator () (osg::GraphicsContext* context);
121 
122 };
123 
125 {
126  public:
127 
128  EndOfDynamicDrawBlock(unsigned int);
129 
130  void completed(osg::State* state);
131 
132  protected:
133 
135 };
136 
137 }
138 
139 #endif
BarrierOperation(int numThreads, PreBlockOp op=NO_OPERATION, bool keep=true)
#define OSG_EXPORT
Definition: Export.h:43
GraphicsOperation(const std::string &name, bool keep)
This class provides an object-oriented thread barrier interface.
Definition: Barrier.h:37
Definition: AlphaFunc.h:19