VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtOsgToGlContextTracker.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 
11 #pragma once
12 #include <vrvOsg/vrvOsg.h>
13 
15 
17 
18 #include <unordered_map>
19 #include <unordered_set>
20 
21 namespace makVrv
22 {
23  class DtDe;
24  class DtIndirectLog;
25 
29  {
30  public:
32  static DtOsgToGlContextTracker& instance(DtDe& de);
33 
35  virtual ~DtOsgToGlContextTracker();
36 
38  DtOsgToGlContextTracker() = delete;
40  DtOsgToGlContextTracker& operator=(const DtOsgToGlContextTracker& rhs) = delete;
43  public:
46  virtual void run();
47 
52  virtual const void* currentGlContext(void) const;
53 
56  boost::signalslib::signal<void(const void*)> signal_newContextAdded;
57 
60  boost::signalslib::signal<void(const void*)> signal_contextAboutToBeDestroyed;
61 
62  public:
66  virtual void contextAboutToBeDestroyed(const void* glContext);
67 
68  protected:
71  protected:
73 
74  const void* myCurrentGlContext = nullptr;
75 
76  std::unordered_set<const void*> myGlContexts;
77 
79  };
80 }
Virtual base class. Allows for RTTI and proper virtual destruction. Used by Creators, Factories, Providers, Assemblers and User Interfaces.
Definition: DtVirtualBaseClass.h:19
DtIndirectLog & myIndirectLog
Definition: DtOsgToGlContextTracker.h:78
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
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
DtDe & myDe
Definition: DtOsgToGlContextTracker.h:72
boost::signalslib::signal< void(const void *)> signal_contextAboutToBeDestroyed
This is the signal that vrv clients should connect to, to get the event that the context is about to ...
Definition: DtOsgToGlContextTracker.h:60
Contains makVrv::DtVirtualBaseClass class.
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.
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
std::unordered_set< const void * > myGlContexts
Definition: DtOsgToGlContextTracker.h:76
boost::signalslib::signal< void(const void *)> signal_newContextAdded
This is the signal that vrv clients should connect to, to get the event that a new context was detect...
Definition: DtOsgToGlContextTracker.h:56

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)