OpenCOVER
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ProgramCache.h
Go to the documentation of this file.
1 /* This file is part of COVISE.
2 
3  You can use it under the terms of the GNU Lesser General Public License
4  version 2.1 or later, see lgpl-2.1.txt.
5 
6  * License: LGPL 2+ */
7 
8 #ifndef PROGRAM_CACHE_H
9 #define PROGRAM_CACHE_H
10 
11 #include <util/common.h>
12 
13 #include <map>
14 
15 #include <osg/Program>
16 
17 typedef std::map<std::string, osg::ref_ptr<osg::Program> > ProgramMap;
18 
19 class PLUGIN_UTILEXPORT ProgramCache
20 {
21 public:
22  static ProgramCache *instance();
23  virtual ~ProgramCache();
24 
25  osg::ref_ptr<osg::Program> getProgram(std::string vertex, std::string fragment);
26  void gc();
27 
28 private:
29  ProgramCache();
30 
31  ProgramMap _programMap;
32 };
33 
34 #endif
std::map< std::string, osg::ref_ptr< osg::Program > > ProgramMap
Definition: ProgramCache.h:17
Definition: ProgramCache.h:19