OGRE  1.7
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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-2011 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  neccessary 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 exmaple 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 
50 namespace Ogre
51 {
60  {
64  };
65 
74  {
75  public:
80 
81  //------------------------------------------------------------------------------//
82  /* Command objects for specifying some base features */
83  /* Any PlugIns wishing to add more specific params to "ExternalTextureSourcePlugins"*/
84  /* dictionary, feel free to do so, that's why this is here */
86  {
87  public:
88  String doGet(const void* target) const;
89  void doSet(void* target, const String& val);
90  };
92  {
93  public:
94  String doGet(const void* target) const;
95  void doSet(void* target, const String& val);
96  };
98  {
99  public:
100  String doGet(const void* target) const;
101  void doSet(void* target, const String& val);
102  };
104  {
105  public:
106  String doGet(const void* target) const;
107  void doSet(void* target, const String& val);
108  };
109  //--------------------------------------------------------//
110  //Base Functions that work with Command String Interface... Or can be called
111  //manually to create video through code
112 
114  void setInputName( String sIN ) { mInputFileName = sIN; }
116  const String& getInputName( ) const { return mInputFileName; }
118  void setFPS( int iFPS ) { mFramesPerSecond = iFPS; }
120  const int getFPS( ) const { return mFramesPerSecond; }
122  void setPlayMode( eTexturePlayMode eMode ) { mMode = eMode; }
124  eTexturePlayMode getPlayMode() const { return mMode; }
125 
127  void setTextureTecPassStateLevel( int t, int p, int s )
128  { mTechniqueLevel = t;mPassLevel = p;mStateLevel = s; }
130  void getTextureTecPassStateLevel( int& t, int& p, int& s ) const
131  {t = mTechniqueLevel; p = mPassLevel; s = mStateLevel;}
132 
134  void addBaseParams();
135 
137  const String& getPlugInStringName( void ) const { return mPlugInName; }
139  const String& getDictionaryStringName( void ) const { return mDictionaryName; }
140 
141  //Pure virtual functions that plugins must Override
143  virtual bool initialise() = 0;
145  virtual void shutDown() = 0;
146 
151  virtual void createDefinedTexture( const String& sMaterialName,
156  virtual void destroyAdvancedTexture( const String& sTextureName,
158 
159  protected:
164 
165 
168 
169  //------ Vars used for setting/getting dictionary stuff -----------//
171 
173 
175 
176  int mFramesPerSecond,
178  mPassLevel,
179  mStateLevel;
180  //------------------------------------------------------------------//
181 
182  protected:
186  };
189 }
190 
191 #endif
static CmdInputFileName msCmdInputFile
eTexturePlayMode getPlayMode() const
Gets currently set play mode.
#define _OgreExport
Definition: OgrePlatform.h:203
void setFPS(int iFPS)
Sets the frames per second - plugin may or may not use this.
IMPORTANT: Plugins must override default dictionary name! Base class that texture plugins derive from...
void setInputName(String sIN)
Sets an input file name - if needed by plugin.
static CmdTecPassState msCmdTecPassState
Command for setting play mode.
static CmdFPS msCmdFramesPerSecond
Command for setting input file name.
String mPlugInName
Command for setting the technique, pass, & state level.
Video starts playing as soon as possible.
const String & getPlugInStringName(void) const
Returns the string name of this PlugIn (as set by the PlugIn)
virtual ~ExternalTextureSource()
Virtual destructor.
Class defining the common interface which classes can use to present a reflection-style, self-defining parameter set to callers.
const String & getDictionaryStringName(void) const
Returns dictionary name.
const String & getInputName() const
Gets currently set input file name.
static OGRE_AUTO_MUTEX String DEFAULT_RESOURCE_GROUP_NAME
Default resource group name.
#define _OgrePrivate
Definition: OgrePlatform.h:204
static CmdPlayMode msCmdPlayMode
Command for setting frames per second.
String mDictionaryName
The string name of the dictionary name - each plugin must override default name.
eTexturePlayMode
Enum for type of texture play mode.
void getTextureTecPassStateLevel(int &t, int &p, int &s) const
Get currently selected Textute attribs.
void setPlayMode(eTexturePlayMode eMode)
Sets a play mode.
void setTextureTecPassStateLevel(int t, int p, int s)
Used for attaching texture to Technique, State, and texture unit layer.
const int getFPS() const
Gets currently set frames per second.
_StringBase String
Abstract class which is command object which gets/sets parameters.