OGRE: OgreExternalTextureSource.h Source File - OGRE Documentation

# 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-2009 Torus Knot Software Ltd
    00008
    00009 Permission is hereby granted, free of charge, to any person obtaining a copy
    00010 of this software and associated documentation files (the "Software"), to deal
    00011 in the Software without restriction, including without limitation the rights
    00012 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    00013 copies of the Software, and to permit persons to whom the Software is
    00014 furnished to do so, subject to the following conditions:
    00015
    00016 The above copyright notice and this permission notice shall be included in
    00017 all copies or substantial portions of the Software.
    00018
    00019 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    00020 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    00021 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    00022 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    00023 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    00024 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    00025 THE SOFTWARE.
    00026 -----------------------------------------------------------------------------
    00027 */
    00028 #ifndef _OgreExternalTextureSource_H
    00029 #define _OgreExternalTextureSource_H
    00030
    00031 /***************************************************************************
    00032 OgreExternalTextureSource.h  -
    00033     Base class that texture plugins need to derive from. This provides the hooks
    00034     neccessary for a plugin developer to easily extend the functionality of dynamic textures.
    00035     It makes creation/destruction of dynamic textures more streamlined. While the plugin
    00036     will need to talk with Ogre for the actual modification of textures, this class allows
    00037     easy integration with Ogre apps. Material script files can be used to aid in the
    00038     creation of dynamic textures. Functionality can be added that is not defined here
    00039     through the use of the base dictionary. For an exmaple of how to use this class and the
    00040     string interface see ffmpegVideoPlugIn.
    00041
    00042 -------------------
    00043 date                 : Jan 1 2004
    00044 email                : pjcast@yahoo.com
    00045 ***************************************************************************/
    00046
    00047 #include "OgreStringInterface.h"
    00048 #include "OgreResourceGroupManager.h"
    00049
    00050 namespace Ogre
    00051 {
    00059     enum eTexturePlayMode
    00060     {
    00061         TextureEffectPause = 0,
    00062         TextureEffectPlay_ASAP = 1,
    00063         TextureEffectPlay_Looping = 2
    00064     };
    00065
    00073     class _OgreExport ExternalTextureSource : public StringInterface
    00074     {
    00075     public:
    00077         ExternalTextureSource();
    00079         virtual ~ExternalTextureSource() {}
    00080
    00081         //------------------------------------------------------------------------------//
    00082         /* Command objects for specifying some base features                            */
    00083         /* Any PlugIns wishing to add more specific params to "ExternalTextureSourcePlugins"*/
    00084         /* dictionary, feel free to do so, that's why this is here                      */
    00085         class _OgrePrivate CmdInputFileName : public ParamCommand
    00086         {
    00087         public:
    00088             String doGet(const void* target) const;
    00089             void doSet(void* target, const String& val);
    00090         };
    00091         class _OgrePrivate CmdFPS : public ParamCommand
    00092         {
    00093         public:
    00094             String doGet(const void* target) const;
    00095             void doSet(void* target, const String& val);
    00096         };
    00097         class _OgrePrivate CmdPlayMode : public ParamCommand
    00098         {
    00099         public:
    00100             String doGet(const void* target) const;
    00101             void doSet(void* target, const String& val);
    00102         };
    00103         class _OgrePrivate CmdTecPassState : public ParamCommand
    00104         {
    00105         public:
    00106             String doGet(const void* target) const;
    00107             void doSet(void* target, const String& val);
    00108         };
    00109         //--------------------------------------------------------//
    00110         //Base Functions that work with Command String Interface... Or can be called
    00111         //manually to create video through code
    00112
    00114         void setInputName( String sIN ) { mInputFileName = sIN; }
    00116         const String& getInputName( ) const { return mInputFileName; }
    00118         void setFPS( int iFPS ) { mFramesPerSecond = iFPS; }
    00120         const int getFPS( ) const { return mFramesPerSecond; }
    00122         void setPlayMode( eTexturePlayMode eMode )  { mMode = eMode; }
    00124         eTexturePlayMode getPlayMode() const { return mMode; }
    00125
    00127         void setTextureTecPassStateLevel( int t, int p, int s )
    00128                 { mTechniqueLevel = t;mPassLevel = p;mStateLevel = s; }
    00130         void getTextureTecPassStateLevel( int& t, int& p, int& s ) const
    00131                 {t = mTechniqueLevel;   p = mPassLevel; s = mStateLevel;}
    00132
    00134         void addBaseParams();
    00135
    00137         const String& getPlugInStringName( void ) const { return mPlugInName; }
    00139         const String& getDictionaryStringName( void ) const { return mDictionaryName; }
    00140
    00141         //Pure virtual functions that plugins must Override
    00143         virtual bool initialise() = 0;
    00145         virtual void shutDown() = 0;
    00146
    00151         virtual void createDefinedTexture( const String& sMaterialName,
    00152             const String& groupName = ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME) = 0;
    00156         virtual void destroyAdvancedTexture( const String& sTextureName,
    00157             const String& groupName = ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME) = 0;
    00158
    00159     protected:
    00160         static CmdInputFileName msCmdInputFile;
    00161         static CmdFPS msCmdFramesPerSecond;
    00162         static CmdPlayMode msCmdPlayMode;
    00163         static CmdTecPassState msCmdTecPassState;
    00164
    00165
    00167         String mPlugInName;
    00168
    00169         //------ Vars used for setting/getting dictionary stuff -----------//
    00170         eTexturePlayMode mMode;
    00171
    00172         String mInputFileName;
    00173
    00174         bool mUpdateEveryFrame;
    00175
    00176         int mFramesPerSecond,
    00177             mTechniqueLevel,
    00178             mPassLevel,
    00179             mStateLevel;
    00180         //------------------------------------------------------------------//
    00181
    00182     protected:
    00185         String mDictionaryName;
    00186     };
    00189 }
    00190
    00191 #endif

Copyright © 2008 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Wed Nov 3 2010 19:24:51