root/OpenSceneGraph/trunk/examples/osgshaders/GL2Scene.h @ 6941

Revision 6941, 1.7 kB (checked in by robert, 8 years ago)

From Martin Lavery and Robert Osfield, Updated examples to use a variation of the MIT License

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1/* -*-c++-*-
2*
3*  OpenSceneGraph example, osgshaders.
4*
5*  Permission is hereby granted, free of charge, to any person obtaining a copy
6*  of this software and associated documentation files (the "Software"), to deal
7*  in the Software without restriction, including without limitation the rights
8*  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9*  copies of the Software, and to permit persons to whom the Software is
10*  furnished to do so, subject to the following conditions:
11*
12*  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13*  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14*  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15*  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16*  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17*  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
18*  THE SOFTWARE.
19*/
20
21/* file:        examples/osgglsl/GL2Scene.h
22 * author:      Mike Weiblen 2005-03-30
23 *
24 * See http://www.3dlabs.com/opengl2/ for more information regarding
25 * the OpenGL Shading Language.
26*/
27
28#include <osg/Node>
29#include <osg/Referenced>
30#include <osg/ref_ptr>
31
32#include <osg/Program>
33
34class GL2Scene : public osg::Referenced
35{
36    public:
37        GL2Scene();
38
39        osg::ref_ptr<osg::Group> getRootNode() { return _rootNode; }
40        void reloadShaderSource();
41        void toggleShaderEnable();
42
43    protected:
44        ~GL2Scene();
45
46    private:    /*methods*/
47        osg::ref_ptr<osg::Group> buildScene();
48
49    private:    /*data*/
50        osg::ref_ptr<osg::Group> _rootNode;
51        std::vector< osg::ref_ptr<osg::Program> > _programList;
52        bool _shadersEnabled;
53};
54
55typedef osg::ref_ptr<GL2Scene> GL2ScenePtr;
56
57/*EOF*/
Note: See TracBrowser for help on using the browser.