Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages

# OgreExternalTextureSource.h

Go to the documentation of this file.

    00001 /*
    00002 -----------------------------------------------------------------------------
    00003 This source file is part of OGRE
    00004     (Object-oriented Graphics Rendering Engine)
    00005 For the latest info, see http://www.ogre3d.org/
    00006
    00007 Copyright © 2000-2004 The OGRE Team
    00008 Also see acknowledgements in Readme.html
    00009
    00010 This program is free software; you can redistribute it and/or modify it under
    00011 the terms of the GNU Lesser General Public License as published by the Free Software
    00012 Foundation; either version 2 of the License, or (at your option) any later
    00013 version.
    00014
    00015 This program is distributed in the hope that it will be useful, but WITHOUT
    00016 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
    00017 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
    00018
    00019 You should have received a copy of the GNU Lesser General Public License along with
    00020 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
    00021 Place - Suite 330, Boston, MA 02111-1307, USA, or go to
    00022 http://www.gnu.org/copyleft/lesser.txt.
    00023 -----------------------------------------------------------------------------
    00024 */
    00025 #ifndef _OgreExternalTextureSource_H
    00026 #define _OgreExternalTextureSource_H
    00027
    00028 /***************************************************************************
    00029 OgreExternalTextureSource.h  -
    00030     Base class that texture plugins need to derive from. This provides the hooks
    00031     neccessary for a plugin developer to easily extend the functionality of dynamic textures.
    00032     It makes creation/destruction of dynamic textures more streamlined. While the plugin
    00033     will need to talk with Ogre for the actual modification of textures, this class allows
    00034     easy integration with Ogre apps. Material script files can be used to aid in the
    00035     creation of dynamic textures. Functionality can be added that is not defined here
    00036     through the use of the base dictionary. For an exmaple of how to use this class and the
    00037     string interface see ffmpegVideoPlugIn.
    00038
    00039 -------------------
    00040 date                 : Jan 1 2004
    00041 email                : pjcast@yahoo.com
    00042 ***************************************************************************/
    00043
    00044 #include "OgreStringInterface.h"
    00045
    00046 namespace Ogre
    00047 {
    00049     enum eTexturePlayMode
    00050     {
    00051         TextureEffectPause = 0,
    00052         TextureEffectPlay_ASAP = 1,
    00053         TextureEffectPlay_Looping = 2
    00054     };
    00055
    00060     class _OgreExport ExternalTextureSource : public StringInterface
    00061     {
    00062     public:
    00064         ExternalTextureSource();
    00066         virtual ~ExternalTextureSource() {}
    00067
    00068         //------------------------------------------------------------------------------//
    00069         /* Command objects for specifying some base features                            */
    00070         /* Any PlugIns wishing to add more specific params to "ExternalTextureSourcePlugins"*/
    00071         /* dictionary, feel free to do so, that's why this is here                      */
    00072         class CmdInputFileName : public ParamCommand
    00073         {
    00074         public:
    00075             String doGet(const void* target) const;
    00076             void doSet(void* target, const String& val);
    00077         };
    00078         class CmdFPS : public ParamCommand
    00079         {
    00080         public:
    00081             String doGet(const void* target) const;
    00082             void doSet(void* target, const String& val);
    00083         };
    00084         class CmdPlayMode : public ParamCommand
    00085         {
    00086         public:
    00087             String doGet(const void* target) const;
    00088             void doSet(void* target, const String& val);
    00089         };
    00090         class CmdTecPassState : public ParamCommand
    00091         {
    00092         public:
    00093             String doGet(const void* target) const;
    00094             void doSet(void* target, const String& val);
    00095         };
    00096         //--------------------------------------------------------//
    00097         //Base Functions that work with Command String Interface... Or can be called
    00098         //manually to create video through code
    00099
    00101         void setInputName( String sIN ) { mInputFileName = sIN; }
    00103         const String& getInputName( ) const { return mInputFileName; }
    00105         void setFPS( int iFPS ) { mFramesPerSecond = iFPS; }
    00107         const int getFPS( ) const { return mFramesPerSecond; }
    00109         void setPlayMode( eTexturePlayMode eMode )  { mMode = eMode; }
    00111         eTexturePlayMode getPlayMode() const { return mMode; }
    00112
    00114         void setTextureTecPassStateLevel( int t, int p, int s )
    00115                 { mTechniqueLevel = t;mPassLevel = p;mStateLevel = s; }
    00117         void getTextureTecPassStateLevel( int& t, int& p, int& s ) const
    00118                 {t = mTechniqueLevel;   p = mPassLevel; s = mStateLevel;}
    00119
    00121         void addBaseParams();
    00122
    00124         const String& getPlugInStringName( ) { return mPlugInName; }
    00126         const String& getDictionaryStringName( ) { return mDictionaryName; }
    00127
    00128         //Pure virtual functions that plugins must Override
    00130         virtual bool Initialise() = 0;
    00132         virtual void ShutDown() = 0;
    00133
    00138         virtual void createDefinedTexture( String sMaterialName ) = 0;
    00140         virtual void DestroyAdvancedTexture( String sTextureName ) = 0;
    00141
    00142     protected:
    00143         static CmdInputFileName msCmdInputFile;
    00144         static CmdFPS msCmdFramesPerSecond;
    00145         static CmdPlayMode msCmdPlayMode;
    00146         static CmdTecPassState msCmdTecPassState;
    00147
    00148
    00150         String mPlugInName;
    00151
    00152         //------ Vars used for setting/getting dictionary stuff -----------//
    00153         eTexturePlayMode mMode;
    00154
    00155         String mInputFileName;
    00156
    00157         bool mUpdateEveryFrame;
    00158
    00159         int mFramesPerSecond,
    00160             mTechniqueLevel,
    00161             mPassLevel,
    00162             mStateLevel;
    00163         //------------------------------------------------------------------//
    00164
    00165     private:
    00167         String mDictionaryName;
    00168     };
    00169 }
    00170
    00171 #endif

Copyright © 2002-2003 by The OGRE Team
Last modified Sun Nov 28 19:48:24 2004