Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class 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 (c) 2000-2005 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 #include "OgreResourceGroupManager.h"
00046 
00047 namespace Ogre
00048 {
00050     enum eTexturePlayMode
00051     {
00052         TextureEffectPause = 0,         
00053         TextureEffectPlay_ASAP = 1,     
00054         TextureEffectPlay_Looping = 2   
00055     };
00056 
00064     class _OgreExport ExternalTextureSource : public StringInterface
00065     {
00066     public:
00068         ExternalTextureSource();
00070         virtual ~ExternalTextureSource() {}
00071 
00072         //------------------------------------------------------------------------------//
00073         /* Command objects for specifying some base features                            */
00074         /* Any PlugIns wishing to add more specific params to "ExternalTextureSourcePlugins"*/
00075         /* dictionary, feel free to do so, that's why this is here                      */
00076         class _OgrePrivate CmdInputFileName : public ParamCommand
00077         {
00078         public:
00079             String doGet(const void* target) const;
00080             void doSet(void* target, const String& val);
00081         };
00082         class _OgrePrivate CmdFPS : public ParamCommand
00083         {
00084         public:
00085             String doGet(const void* target) const;
00086             void doSet(void* target, const String& val);
00087         };
00088         class _OgrePrivate CmdPlayMode : public ParamCommand
00089         {
00090         public:
00091             String doGet(const void* target) const;
00092             void doSet(void* target, const String& val);
00093         };
00094         class _OgrePrivate CmdTecPassState : public ParamCommand
00095         {
00096         public:
00097             String doGet(const void* target) const;
00098             void doSet(void* target, const String& val);
00099         };
00100         //--------------------------------------------------------//
00101         //Base Functions that work with Command String Interface... Or can be called
00102         //manually to create video through code 
00103 
00105         void setInputName( String sIN ) { mInputFileName = sIN; }
00107         const String& getInputName( ) const { return mInputFileName; }
00109         void setFPS( int iFPS ) { mFramesPerSecond = iFPS; }
00111         const int getFPS( ) const { return mFramesPerSecond; }
00113         void setPlayMode( eTexturePlayMode eMode )  { mMode = eMode; }
00115         eTexturePlayMode getPlayMode() const { return mMode; }
00116 
00118         void setTextureTecPassStateLevel( int t, int p, int s ) 
00119                 { mTechniqueLevel = t;mPassLevel = p;mStateLevel = s; }
00121         void getTextureTecPassStateLevel( int& t, int& p, int& s ) const
00122                 {t = mTechniqueLevel;   p = mPassLevel; s = mStateLevel;}
00123         
00125         void addBaseParams();
00126 
00128         const String& getPlugInStringName( void ) const { return mPlugInName; }
00130         const String& getDictionaryStringName( void ) const { return mDictionaryName; }
00131 
00132         //Pure virtual functions that plugins must Override
00134         virtual bool initialise() = 0;
00136         virtual void shutDown() = 0;
00137 
00142         virtual void createDefinedTexture( const String& sMaterialName,
00143             const String& groupName = ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME) = 0;
00147         virtual void destroyAdvancedTexture( const String& sTextureName,
00148             const String& groupName = ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME) = 0;
00149 
00150     protected:
00151         static CmdInputFileName msCmdInputFile;     
00152         static CmdFPS msCmdFramesPerSecond;         
00153         static CmdPlayMode msCmdPlayMode;           
00154         static CmdTecPassState msCmdTecPassState;   
00155 
00156 
00158         String mPlugInName;
00159     
00160         //------ Vars used for setting/getting dictionary stuff -----------//
00161         eTexturePlayMode mMode;
00162         
00163         String mInputFileName;
00164         
00165         bool mUpdateEveryFrame;
00166         
00167         int mFramesPerSecond,
00168             mTechniqueLevel,
00169             mPassLevel, 
00170             mStateLevel;
00171         //------------------------------------------------------------------//
00172 
00173     protected:
00176         String mDictionaryName;
00177     };
00178 }
00179 
00180 #endif

Copyright © 2000-2005 by The OGRE Team
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun Mar 12 14:37:40 2006