VR-Forces 4.8 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 {
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 }
float getValue(const osg::View *v) const
Get the uniform value for the specified view.
GLuint findLocation(const osg::Program::PerContextProgram *program)
Find the uniform&#39;s location in the program object.
ViewToValue myViewToValue
Definition: DtPerViewUniformCallback.h:55
unsigned int GLuint
Definition: DtGlTextureBufferObject.h:17
virtual void drawImplementation(osg::RenderInfo &renderInfo, const osg::Drawable *drawable) const
Draw with the appropriate uniform value.
void setValue(const osg::View *v, int val)
Set the uniform value for the specified view.
boost::unordered_map< const osg::View *, float > ViewToValue
Definition: DtPerViewUniformCallback.h:54
META_Object(makVrv, DtPerViewUniformCallback)
boost::unordered_map< ProgramKey, GLuint > ProgramToUniformLoc
Definition: DtPerViewUniformCallback.h:51
ProgramToUniformLoc myProgramToUniformLoc
Definition: DtPerViewUniformCallback.h:52
Contains DLL export macros.
std::pair< const osg::Program::PerContextProgram *, GLuint > ProgramKey
Definition: DtPerViewUniformCallback.h:50
virtual ~DtPerViewUniformCallback()
DTOR.
Callback to set a uniform value on a per-view basis.
Definition: DtPerViewUniformCallback.h:21

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)