VR-Forces 5.0.2 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtEffectControllerShaderCache.h
Go to the documentation of this file.
1 /*****************************************************************************
2 * Copyright (c) 2019 MAK Technologies, Inc.
3 * All rights reserved.
4 *****************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
13 
14 #include <string>
15 
16 #include <tbb/spin_rw_mutex.h>
17 #include <map>
18 
19 namespace makVrv
20 {
21  class DtOsgFileCache;
22  class DtDe;
23 
27  {
28  public:
31 
34 
35  private:
36 
43 
44  public:
47  virtual const std::string& vertShaderSource(const std::string& vertShaderFile, int textureUnit) const;
48 
51  virtual const std::string& fragShaderSource(const std::string& fragShaderFile, bool forTexArray, const std::string& effectUnitName) const;
52  protected:
54  virtual std::string generateVertShaderSource(const std::string& vertShaderFile, int textureUnit) const;
55 
57  virtual std::string generateFragShaderSource(const std::string& fragShaderFile, bool forTexArray, const std::string& effectUnitName) const;
58  protected:
60 
61  typedef std::pair<std::string, int> VertShaderKey;
62  typedef std::map<VertShaderKey, std::string> MapVertShaders;
63 
65 
66  typedef std::pair<std::string, bool> FragShaderKey;
67  typedef std::map<FragShaderKey, std::string> MapFragShaders;
69 
70  mutable tbb::spin_rw_mutex myFragMapMutex;
71  mutable tbb::spin_rw_mutex myVertMapMutex;
72 
74  };
75 }
std::map< VertShaderKey, std::string > MapVertShaders
Definition: DtEffectControllerShaderCache.h:62
DtDe & myDe
Definition: DtEffectControllerShaderCache.h:73
std::map< FragShaderKey, std::string > MapFragShaders
Definition: DtEffectControllerShaderCache.h:67
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
brief DtEffectControllerShaderCache is a cache for shaders used by effect texture controller ...
Definition: DtEffectControllerShaderCache.h:26
const DtOsgFileCache & myFileCache
Definition: DtEffectControllerShaderCache.h:59
std::pair< std::string, bool > FragShaderKey
Definition: DtEffectControllerShaderCache.h:66
The OSG implementation of makVrv::DtOsgFileCache. This will cache files as .ive&#39;s for quicker load ti...
Definition: DtOsgFileCache.h:54
tbb::spin_rw_mutex myVertMapMutex
Definition: DtEffectControllerShaderCache.h:71
MapVertShaders myMapVertShaders
Definition: DtEffectControllerShaderCache.h:64
Contains DLL export macros.
std::pair< std::string, int > VertShaderKey
Definition: DtEffectControllerShaderCache.h:61
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
MapFragShaders myMapFragShaders
Definition: DtEffectControllerShaderCache.h:68
tbb::spin_rw_mutex myFragMapMutex
Definition: DtEffectControllerShaderCache.h:70

Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)