openscenegraph
ShaderComposer
Go to the documentation of this file.
1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
2 *
3 * This library is open source and may be redistributed and/or modified under
4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5 * (at your option) any later version. The full license is in LICENSE file
6 * included with this distribution, and on the openscenegraph.org website.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * OpenSceneGraph Public License for more details.
12*/
13
14#ifndef OSG_SHADERCOMPOSER
15#define OSG_SHADERCOMPOSER 1
16
17#include <osg/Object>
18#include <osg/StateAttribute>
19#include <osg/Program>
20
21namespace osg {
22
23// forward declare osg::State
24class State;
25
26typedef std::vector<osg::ShaderComponent*> ShaderComponents;
27
30{
31 public:
32
34 ShaderComposer(const ShaderComposer& sa,const CopyOp& copyop=CopyOp::SHALLOW_COPY);
36
37 virtual osg::Program* getOrCreateProgram(const ShaderComponents& shaderComponents);
38
39 typedef std::vector< const osg::Shader* > Shaders;
40 virtual osg::Shader* composeMain(const Shaders& shaders);
41 virtual void addShaderToProgram(Program* program, const Shaders& shaders);
42
43 virtual void releaseGLObjects(osg::State* state) const;
44
45 protected:
46
47 virtual ~ShaderComposer();
48
49
50 typedef std::map< ShaderComponents, ref_ptr<Program> > ProgramMap;
52
53 typedef std::map< Shaders, ref_ptr<Shader> > ShaderMainMap;
55
56};
57
58}
59
60#endif
Definition CopyOp:41
Definition Object:61
Definition osg/Program:52
deprecated
Definition ShaderComposer:30
std::vector< const osg::Shader * > Shaders
Definition ShaderComposer:39
virtual ~ShaderComposer()
virtual osg::Shader * composeMain(const Shaders &shaders)
ShaderMainMap _shaderMainMap
Definition ShaderComposer:54
META_Object(osg, ShaderComposer)
ProgramMap _programMap
Definition ShaderComposer:51
virtual osg::Program * getOrCreateProgram(const ShaderComponents &shaderComponents)
ShaderComposer(const ShaderComposer &sa, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
virtual void addShaderToProgram(Program *program, const Shaders &shaders)
std::map< ShaderComponents, ref_ptr< Program > > ProgramMap
Definition ShaderComposer:50
std::map< Shaders, ref_ptr< Shader > > ShaderMainMap
Definition ShaderComposer:53
virtual void releaseGLObjects(osg::State *state) const
Definition Shader:89
Definition State:80
author: Julien Valentin 2017 (mp3butcher@hotmail.com)
Definition AlphaFunc:19
std::vector< osg::ShaderComponent * > ShaderComponents
Definition ShaderComposer:26
#define OSG_EXPORT
Definition osg/Export:39