VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtGlVaoManager.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2020 VT-MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
13 
14 #include <vrvCore/DtDe.h>
15 
17 
18 #include <boost/unordered_map.hpp>
19 
20 #include <osg/GraphicsContext>
21 #include <osg/State>
22 
23 
24 namespace makVrv
25 {
26  // Forward declarations.
27  class DtWindow;
28 
29 
50  {
51  public:
52 
55 
57  virtual ~DtGlVaoManager();
58 
59  private:
60 
63 
65  DtGlVaoManager(const DtGlVaoManager &other);
66 
68  DtGlVaoManager &operator=(const DtGlVaoManager &other);
69 
70  public:
74  virtual GLuint getOrCreateVao(osg::State* state, bool& created) const;
75 
79  virtual void clearVao(osg::GraphicsContext* graphicsContext) const;
80 
85  virtual void deleteQueuedVaos(osg::GraphicsContext* graphicsContext) const;
86 
87  protected:
88 
94  virtual void deleteQueuedVaosInAllGc(osg::GraphicsContext* graphicsContext) const;
95 
97  virtual void slot_windowToBeDestroyed(DtWindow* window);
98 
99  protected:
100 
103 
106  typedef std::map<osg::observer_ptr<const osg::GraphicsContext>, GLuint> MapContextToVao;
108 
109  typedef std::vector<GLuint> VaoArray;
110  typedef std::map<osg::observer_ptr<const osg::GraphicsContext>, VaoArray > MapContextsToVaoArray;
114  };
115 
116 
119  {
120  public:
123 
125  virtual ~DtGlVaoManagerCreator();
126 
127  private:
131  DtGlVaoManagerCreator &operator=(const DtGlVaoManagerCreator& other);
132 
133  public:
135  virtual DtGlVaoManager* create() const;
136 
139  static DtGlVaoManagerCreator& instance(DtDe& de);
140 
142  static const std::string& theClassName();
143 
144  protected:
146  };
147 }
Abstract Base class.
Definition: DtWindow.h:25
Virtual base class.
Definition: DtVirtualBaseClass.h:22
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
std::vector< GLuint > VaoArray
Definition: DtGlVaoManager.h:109
unsigned int GLuint
Definition: DtGlTextureBufferObject.h:17
Contains makVrv::DtDe class.
MapContextsToVaoArray myMutableGraphicsContextToVaoArrayToDelete
Keep track of what vertex array objects (VAOs) we have seen per context so that we can delete the Vao...
Definition: DtGlVaoManager.h:113
DtSignalConnectionManager myConnections
Definition: DtGlVaoManager.h:102
std::map< osg::observer_ptr< const osg::GraphicsContext >, VaoArray > MapContextsToVaoArray
Definition: DtGlVaoManager.h:110
DtDe & myDe
Definition: DtGlVaoManager.h:101
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:24
creator for DtGlVaoManager
Definition: DtGlVaoManager.h:118
Base class to provide boost signal/slot management.
This class is used to manage an opengl vertex array object (VAO) dealing with multiple opengl context...
Definition: DtGlVaoManager.h:49
std::map< osg::observer_ptr< const osg::GraphicsContext >, GLuint > MapContextToVao
Mutables below.
Definition: DtGlVaoManager.h:106
Contains DLL export macros.
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
DtDe & myDe
Definition: DtGlVaoManager.h:145
MapContextToVao myMutableGraphicsContextToVao
Definition: DtGlVaoManager.h:107

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)