OgreExternalTextureSource.h
Go to the documentation of this file.
1 /*
2 -----------------------------------------------------------------------------
3 This source file is part of OGRE
4  (Object-oriented Graphics Rendering Engine)
5 For the latest info, see http://www.ogre3d.org/
6 
7 Copyright (c) 2000-2013 Torus Knot Software Ltd
8 
9 Permission is hereby granted, free of charge, to any person obtaining a copy
10 of this software and associated documentation files (the "Software"), to deal
11 in the Software without restriction, including without limitation the rights
12 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 copies of the Software, and to permit persons to whom the Software is
14 furnished to do so, subject to the following conditions:
15 
16 The above copyright notice and this permission notice shall be included in
17 all copies or substantial portions of the Software.
18 
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 THE SOFTWARE.
26 -----------------------------------------------------------------------------
27 */
28 #ifndef _OgreExternalTextureSource_H
29 #define _OgreExternalTextureSource_H
30 
31 /***************************************************************************
32 OgreExternalTextureSource.h -
33  Base class that texture plugins need to derive from. This provides the hooks
34  necessary for a plugin developer to easily extend the functionality of dynamic textures.
35  It makes creation/destruction of dynamic textures more streamlined. While the plugin
36  will need to talk with Ogre for the actual modification of textures, this class allows
37  easy integration with Ogre apps. Material script files can be used to aid in the
38  creation of dynamic textures. Functionality can be added that is not defined here
39  through the use of the base dictionary. For an example of how to use this class and the
40  string interface see ffmpegVideoPlugIn.
41 
42 -------------------
43 date : Jan 1 2004
44 email : pjcast@yahoo.com
45 ***************************************************************************/
46 
47 #include "OgreStringInterface.h"
49 #include "OgreHeaderPrefix.h"
50 
51 namespace Ogre
52 {
61  {
65  };
66 
75  {
76  public:
81 
82  //------------------------------------------------------------------------------//
83  /* Command objects for specifying some base features */
84  /* Any Plugins wishing to add more specific params to "ExternalTextureSourcePlugins"*/
85  /* dictionary, feel free to do so, that's why this is here */
87  {
88  public:
89  String doGet(const void* target) const;
90  void doSet(void* target, const String& val);
91  };
93  {
94  public:
95  String doGet(const void* target) const;
96  void doSet(void* target, const String& val);
97  };
99  {
100  public:
101  String doGet(const void* target) const;
102  void doSet(void* target, const String& val);
103  };
105  {
106  public:
107  String doGet(const void* target) const;
108  void doSet(void* target, const String& val);
109  };
110  //--------------------------------------------------------//
111  //Base Functions that work with Command String Interface... Or can be called
112  //manually to create video through code
113 
115  void setInputName( String sIN ) { mInputFileName = sIN; }
117  const String& getInputName( ) const { return mInputFileName; }
119  void setFPS( int iFPS ) { mFramesPerSecond = iFPS; }
121  int getFPS( ) const { return mFramesPerSecond; }
123  void setPlayMode( eTexturePlayMode eMode ) { mMode = eMode; }
125  eTexturePlayMode getPlayMode() const { return mMode; }
126 
128  void setTextureTecPassStateLevel( int t, int p, int s )
129  { mTechniqueLevel = t;mPassLevel = p;mStateLevel = s; }
131  void getTextureTecPassStateLevel( int& t, int& p, int& s ) const
132  {t = mTechniqueLevel; p = mPassLevel; s = mStateLevel;}
133 
136 
138  const String& getPluginStringName( void ) const { return mPluginName; }
140  const String& getDictionaryStringName( void ) const { return mDictionaryName; }
141 
142  //Pure virtual functions that plugins must Override
144  virtual bool initialise() = 0;
146  virtual void shutDown() = 0;
147 
152  virtual void createDefinedTexture( const String& sMaterialName,
157  virtual void destroyAdvancedTexture( const String& sTextureName,
159 
160  protected:
165 
166 
169 
170  //------ Vars used for setting/getting dictionary stuff -----------//
172 
174 
176 
181  //------------------------------------------------------------------//
182 
183  protected:
187  };
190 }
191 
192 #include "OgreHeaderSuffix.h"
193 
194 #endif
OgreHeaderSuffix.h
Ogre::ExternalTextureSource::CmdInputFileName
Definition: OgreExternalTextureSource.h:87
Ogre::ExternalTextureSource::mUpdateEveryFrame
bool mUpdateEveryFrame
Definition: OgreExternalTextureSource.h:175
Ogre::ExternalTextureSource::ExternalTextureSource
ExternalTextureSource()
Constructor.
Ogre
Definition: OgreAndroidLogListener.h:35
Ogre::ExternalTextureSource::setInputName
void setInputName(String sIN)
Sets an input file name - if needed by plugin.
Definition: OgreExternalTextureSource.h:115
Ogre::ExternalTextureSource::getPluginStringName
const String & getPluginStringName(void) const
Returns the string name of this Plugin (as set by the Plugin)
Definition: OgreExternalTextureSource.h:138
Ogre::ExternalTextureSource::addBaseParams
void addBaseParams()
Call from derived classes to ensure the dictionary is setup.
Ogre::eTexturePlayMode
eTexturePlayMode
Enum for type of texture play mode.
Definition: OgreExternalTextureSource.h:61
Ogre::ExternalTextureSource::CmdInputFileName::doGet
String doGet(const void *target) const
Ogre::ExternalTextureSource::CmdFPS::doGet
String doGet(const void *target) const
Ogre::ExternalTextureSource::destroyAdvancedTexture
virtual void destroyAdvancedTexture(const String &sTextureName, const String &groupName=ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME)=0
What this destroys is dependent on the plugin...
Ogre::ExternalTextureSource::mMode
eTexturePlayMode mMode
Definition: OgreExternalTextureSource.h:171
Ogre::ExternalTextureSource::shutDown
virtual void shutDown()=0
Shuts down Plugin.
Ogre::ExternalTextureSource::setTextureTecPassStateLevel
void setTextureTecPassStateLevel(int t, int p, int s)
Used for attaching texture to Technique, State, and texture unit layer.
Definition: OgreExternalTextureSource.h:128
Ogre::ExternalTextureSource::CmdFPS
Definition: OgreExternalTextureSource.h:93
Ogre::ExternalTextureSource::CmdFPS::doSet
void doSet(void *target, const String &val)
Ogre::String
_StringBase String
Definition: OgrePrerequisites.h:439
OgreResourceGroupManager.h
Ogre::ExternalTextureSource::msCmdTecPassState
static CmdTecPassState msCmdTecPassState
Command for setting play mode.
Definition: OgreExternalTextureSource.h:164
Ogre::ExternalTextureSource::CmdPlayMode::doSet
void doSet(void *target, const String &val)
Ogre::ExternalTextureSource::setPlayMode
void setPlayMode(eTexturePlayMode eMode)
Sets a play mode.
Definition: OgreExternalTextureSource.h:123
Ogre::ExternalTextureSource::createDefinedTexture
virtual void createDefinedTexture(const String &sMaterialName, const String &groupName=ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME)=0
Creates a texture into an already defined material or one that is created new (it's up to plugin to u...
Ogre::ExternalTextureSource::CmdPlayMode
Definition: OgreExternalTextureSource.h:99
Ogre::ParamCommand
Abstract class which is command object which gets/sets parameters.
Definition: OgreStringInterface.h:80
Ogre::ExternalTextureSource
IMPORTANT: Plugins must override default dictionary name! Base class that texture plugins derive from...
Definition: OgreExternalTextureSource.h:75
Ogre::ExternalTextureSource::initialise
virtual bool initialise()=0
Call this function from manager to init system.
Ogre::ExternalTextureSource::getInputName
const String & getInputName() const
Gets currently set input file name.
Definition: OgreExternalTextureSource.h:117
OgreStringInterface.h
Ogre::ExternalTextureSource::mPassLevel
int mPassLevel
Definition: OgreExternalTextureSource.h:179
OgreHeaderPrefix.h
Ogre::ExternalTextureSource::mStateLevel
int mStateLevel
Definition: OgreExternalTextureSource.h:180
Ogre::ExternalTextureSource::mInputFileName
String mInputFileName
Definition: OgreExternalTextureSource.h:173
Ogre::ExternalTextureSource::CmdPlayMode::doGet
String doGet(const void *target) const
Ogre::ExternalTextureSource::~ExternalTextureSource
virtual ~ExternalTextureSource()
Virtual destructor.
Definition: OgreExternalTextureSource.h:80
Ogre::ExternalTextureSource::CmdInputFileName::doSet
void doSet(void *target, const String &val)
Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME
static String DEFAULT_RESOURCE_GROUP_NAME
Default resource group name.
Definition: OgreResourceGroupManager.h:266
Ogre::ExternalTextureSource::msCmdFramesPerSecond
static CmdFPS msCmdFramesPerSecond
Command for setting input file name.
Definition: OgreExternalTextureSource.h:162
Ogre::ExternalTextureSource::getPlayMode
eTexturePlayMode getPlayMode() const
Gets currently set play mode.
Definition: OgreExternalTextureSource.h:125
_OgreExport
#define _OgreExport
Definition: OgrePlatform.h:257
Ogre::ExternalTextureSource::CmdTecPassState::doSet
void doSet(void *target, const String &val)
Ogre::ExternalTextureSource::getDictionaryStringName
const String & getDictionaryStringName(void) const
Returns dictionary name.
Definition: OgreExternalTextureSource.h:140
Ogre::StringInterface
Class defining the common interface which classes can use to present a reflection-style,...
Definition: OgreStringInterface.h:164
Ogre::ExternalTextureSource::mFramesPerSecond
int mFramesPerSecond
Definition: OgreExternalTextureSource.h:177
Ogre::ExternalTextureSource::msCmdInputFile
static CmdInputFileName msCmdInputFile
Definition: OgreExternalTextureSource.h:161
Ogre::ExternalTextureSource::setFPS
void setFPS(int iFPS)
Sets the frames per second - plugin may or may not use this.
Definition: OgreExternalTextureSource.h:119
Ogre::ExternalTextureSource::mPluginName
String mPluginName
Command for setting the technique, pass, & state level.
Definition: OgreExternalTextureSource.h:168
_OgrePrivate
#define _OgrePrivate
Definition: OgrePlatform.h:258
Ogre::ExternalTextureSource::getFPS
int getFPS() const
Gets currently set frames per second.
Definition: OgreExternalTextureSource.h:121
Ogre::ExternalTextureSource::mTechniqueLevel
int mTechniqueLevel
Definition: OgreExternalTextureSource.h:178
Ogre::TextureEffectPause
@ TextureEffectPause
Definition: OgreExternalTextureSource.h:62
Ogre::TextureEffectPlay_Looping
@ TextureEffectPlay_Looping
Video starts playing as soon as possible.
Definition: OgreExternalTextureSource.h:64
Ogre::ExternalTextureSource::getTextureTecPassStateLevel
void getTextureTecPassStateLevel(int &t, int &p, int &s) const
Get currently selected Texture attribs.
Definition: OgreExternalTextureSource.h:131
Ogre::ExternalTextureSource::CmdTecPassState::doGet
String doGet(const void *target) const
Ogre::ExternalTextureSource::mDictionaryName
String mDictionaryName
The string name of the dictionary name - each plugin must override default name.
Definition: OgreExternalTextureSource.h:186
Ogre::ExternalTextureSource::CmdTecPassState
Definition: OgreExternalTextureSource.h:105
Ogre::ExternalTextureSource::msCmdPlayMode
static CmdPlayMode msCmdPlayMode
Command for setting frames per second.
Definition: OgreExternalTextureSource.h:163
Ogre::TextureEffectPlay_ASAP
@ TextureEffectPlay_ASAP
Video starts out paused.
Definition: OgreExternalTextureSource.h:63

Copyright © 2012 Torus Knot Software Ltd
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.