VR-Forces 4.0.4 Class Documentation
include/vrvGraphics/DtProjected2DTexturedEffect.h
Go to the documentation of this file.
00001 /*****************************************************************************
00002  * Copyright (c) 2011 MAK Technologies, Inc.
00003  * All rights reserved.
00004  *****************************************************************************/
00005 
00009 
00010 #pragma once
00011 
00012 #include <vrvGraphics/Dt2DEffect.h>
00013 
00014 namespace makVrv
00015 {
00016 
00019    class DT_DLL_VRVGRAPHICS DtProjected2DTexturedEffect : public Dt2DEffect
00020    {
00021    public:
00022 
00024       DtProjected2DTexturedEffect( bool textureIsAlpha );
00025 
00027       virtual ~DtProjected2DTexturedEffect();
00028 
00030       virtual void setCamera( bool geocentric, float geocentricAlpha,
00031          const double position[3], const double projection[16] );
00032 
00033       //Set the number of groups.
00034       virtual void setGroupCount( unsigned int count );
00035 
00037       virtual void setBackgroundImageTextureUnit( unsigned int unit );
00038 
00039       // Sets the given attributes to the OpenGL context.
00040       virtual void setVaryingAttributes( size_t stride,
00041          const VaryingAttributeAddress& positionAddress,
00042          const VaryingAttributeAddress& colorAddress,
00043          const VaryingAttributeAddress& offsetAddress,
00044          const VaryingAttributeAddress& uvAddress,
00045          const VaryingAttributeAddress& rotAddress );
00046 
00048       virtual void unsetVaryingAttributes();
00049 
00050    protected:
00051 
00053       virtual void updateUniformLocations();
00054 
00056       virtual void updateUniforms();
00057 
00059       virtual void getShaderSource( const char*& vs,
00060          const char*& fs, const char*& gs );
00061 
00062    protected:
00063 
00064       int myUniform_Texture;
00065       int myUniform_CameraPos;
00066       int myUniform_CameraMat;
00067       int myUniform_GroupCount;
00068       int myUniform_Sphere;
00069       int myUniform_OccludedAlpha;
00070 
00071       unsigned int myUnit;
00072       unsigned int myGroupCount;
00073       double myCameraPos[3];
00074       double myMatrix[16];
00075       bool myTextureIsAlpha;
00076       bool myGeocentricFlag;
00077       float myGeocentricAlpha;
00078 
00079    };
00080 
00081 
00084    class DT_DLL_VRVGRAPHICS DtProjected2DTexturedEffectCreator : public DtEffectCreator
00085    {
00086    public:
00087 
00088       DtProjected2DTexturedEffectCreator( bool textureIsAlpha )
00089          : myTextureIsAlpha( textureIsAlpha )
00090       {
00091       }
00092 
00093       virtual DtEffect* create( CreateParameters* params = 0 )
00094       {
00095          return new DtProjected2DTexturedEffect( myTextureIsAlpha );
00096       }
00097 
00098    protected:
00099 
00100       bool myTextureIsAlpha;
00101 
00102    };
00103 
00104 }

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)