VR-Forces 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 
19 
20 #include <unordered_map>
21 #include <tuple>
22 
23 namespace makVrv
24 {
25  // Forward declarations.
26  class DtDe;
27  class DtOsgToGlContextTracker;
28  class DtIndirectLog;
29  class DtGlDeleteObjectManager;
30 
33 
36 
38  template <>
39  inline const char* creatorTypeName<DtGlVaoManager>(void) { return "DtGlVaoManagerCreator"; }
40 
59  {
60  public:
63 
65  virtual ~DtGlVaoManager();
66 
67  private:
69  DtGlVaoManager() = delete;
71  DtGlVaoManager(const DtGlVaoManager&) = delete;
73  DtGlVaoManager& operator=(const DtGlVaoManager&) = delete;
74 
75  public:
77  virtual unsigned int getOrCreateVao(bool& created);
78 
83  virtual void clearVaos(void);
84 
85  protected:
88  virtual void slot_contextAboutToBeDestroyed(const void* glContext);
89 
91  virtual void deleteVao(const void* glContext);
92  protected:
94 
97 
98  std::unordered_map<const void*, DtGlVaoAndContext> myGlContextToVao;
99 
101 
103 
105  };
106 }
DtOsgToGlContextTracker & myOsgToGlContextTracker
Definition: DtGlVaoManager.h:100
const char * creatorTypeName< DtGlVaoManager >(void)
template specialization for the creator (pass the class being created to the creatorTypeName template...
Definition: DtGlVaoManager.h:39
This class tracks gl contexts as they are created/destroyed per window creation/destruction. It is also what clients should hook to via signal_contextAboutToBeDestroyed for context destruction cleanup.
Definition: DtOsgToGlContextTracker.h:28
DtIndirectLog & myIndirectLog
Definition: DtGlVaoManager.h:102
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
Encapsulates an opengl object and the context it was created in.
DtSignalConnectionManager myConnections
for handling context destroyed event
Definition: DtGlVaoManager.h:96
std::unordered_map< const void *, DtGlVaoAndContext > myGlContextToVao
Definition: DtGlVaoManager.h:98
Variadic templated creator class for defining a DtVirtualBaseClass creator that is automatically regi...
Definition: DtVirtualBaseClassCreator.h:22
DtDe & myDe
Definition: DtGlVaoManager.h:93
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
This class is specifically used by the indirect system It&#39;s separate so that it doesn&#39;t interfere wit...
Definition: DtIndirectLog.h:30
Base class to provide boost signal/slot management.
DtGlDeleteObjectManager & myGlDeleteObjectManager
Definition: DtGlVaoManager.h:104
Vaos are OpenGL context specific. They need to be deleted in the context they are created in...
Definition: DtGlDeleteObjectManager.h:58
This class is used to manage an opengl vertex array object (VAO) dealing with multiple opengl context...
Definition: DtGlVaoManager.h:58
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:72
DtVirtualBaseClassCreator< DtGlVaoManager > DtGlVaoManagerCreator
creator
Definition: DtGlVaoManager.h:32

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)