VR-Forces 5.0.3 Developer's Guide
 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) 2022 VT-MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
13 
15 
17 
18 
19 #include <osg/GraphicsContext>
20 #include <osg/State>
21 
22 #include <map>
23 #include <tuple>
24 
25 namespace makVrv
26 {
27  // Forward declarations.
28  class DtWindow;
29  class DtDe;
30 
31 
34 
37 
39  template <>
40  inline const char* creatorTypeName<DtGlVaoManager>(void) { return "DtGlVaoManagerCreator"; }
41 
42 
43  // This will only contain the correct context if tracking has been set to true
44  typedef std::tuple<unsigned int, void*> DtGlVaoAndContext;
45 
66  {
67  public:
68 
71 
73  virtual ~DtGlVaoManager();
74 
75  private:
76 
79 
81  DtGlVaoManager(const DtGlVaoManager &other);
82 
84  DtGlVaoManager &operator=(const DtGlVaoManager &other);
85 
86  public:
90  virtual DtGlVaoAndContext getOrCreateVao(const osg::GraphicsContext* graphicsContext, bool& created) const;
91 
95  virtual void clearVao(const osg::GraphicsContext* graphicsContext) const;
96 
101  virtual void deleteQueuedVaos(const osg::GraphicsContext* graphicsContext) const;
102 
103 
104  protected:
105 
111  virtual void deleteQueuedVaosInAllGc(osg::GraphicsContext* graphicsContext) const;
112 
114  virtual void slot_windowToBeDestroyed(DtWindow* window);
115 
117  virtual void attemptToDeleteVao(const void* glContext, DtGlVaoAndContext& fbo) const;
118 
119  protected:
120 
123 
126  typedef std::map<osg::observer_ptr<const osg::GraphicsContext>, DtGlVaoAndContext> MapContextToVao;
128 
129  typedef std::vector<DtGlVaoAndContext> VaoArray;
130  typedef std::map<osg::observer_ptr<const osg::GraphicsContext>, VaoArray > MapContextsToVaoArray;
134 
135  };
136 }
Abstract Base class.
Definition: DtWindow.h:25
std::vector< DtGlVaoAndContext > VaoArray
Definition: DtGlVaoManager.h:129
const char * creatorTypeName< DtGlVaoManager >(void)
template specialization for the creator (pass the class being created to the creatorTypeName template...
Definition: DtGlVaoManager.h:40
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
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:133
DtSignalConnectionManager myConnections
Definition: DtGlVaoManager.h:122
std::map< osg::observer_ptr< const osg::GraphicsContext >, DtGlVaoAndContext > MapContextToVao
Mutables below. These are mutable due to the fact that osg has drawImplementation as const These muta...
Definition: DtGlVaoManager.h:126
std::tuple< unsigned int, void * > DtGlVaoAndContext
Definition: DtGlDeleteObjectManager.h:37
Variadic templated creator class for defining a DtVirtualBaseClass creator that is automatically regi...
Definition: DtVirtualBaseClassCreator.h:22
std::map< osg::observer_ptr< const osg::GraphicsContext >, VaoArray > MapContextsToVaoArray
Definition: DtGlVaoManager.h:130
DtDe & myDe
Definition: DtGlVaoManager.h:121
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
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:65
Contains DLL export macros.
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:70
DtVirtualBaseClassCreator< DtGlVaoManager > DtGlVaoManagerCreator
creator
Definition: DtGlVaoManager.h:33
MapContextToVao myMutableGraphicsContextToVao
Definition: DtGlVaoManager.h:127

Document ID: Generated on Thu Jun 1 17:58:13 EDT 2023 from SVN revision 255404
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)