VR-Forces 4.7 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtPerViewUniformCallback.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2014 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
8 
9 #pragma once
10 
11 #include <vrvOsg/vrvOsg.h>
12 
13 #include <osg/Drawable>
14 
15 #include <boost/unordered_map.hpp>
16 
17 namespace makVrv
18 {
21  class DtPerViewUniformCallback : public osg::Drawable::DrawCallback
22  {
23  public:
26 
28  DtPerViewUniformCallback(const DtPerViewUniformCallback&,const osg::CopyOp&);
29 
31 
33  virtual ~DtPerViewUniformCallback();
34 
36  virtual void drawImplementation(osg::RenderInfo& renderInfo,const osg::Drawable* drawable) const;
37 
39  void setValue(const osg::View* v, int val);
40 
42  float getValue(const osg::View* v) const;
43 
44  protected:
45 
47  GLuint findLocation(const osg::Program::PerContextProgram* program);
48 
49  protected:
50  typedef std::pair<const osg::Program::PerContextProgram*, GLuint> ProgramKey;
51  typedef boost::unordered_map<ProgramKey, GLuint> ProgramToUniformLoc;
53 
54  typedef boost::unordered_map<const osg::View*, float> ViewToValue;
56  };
57 }

Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (www.mak.com)