OpenCOVER
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
17typedef std::map<std::string, osg::ref_ptr<osg::Program> > ProgramMap;
18
19class PLUGIN_UTILEXPORT ProgramCache
20{
21public:
23 virtual ~ProgramCache();
24
25 osg::ref_ptr<osg::Program> getProgram(std::string vertex, std::string fragment);
26 void gc();
27
28private:
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:20
static ProgramCache * instance()
osg::ref_ptr< osg::Program > getProgram(std::string vertex, std::string fragment)
virtual ~ProgramCache()