OgreExternalTextureSource.h
Go to the documentation of this file.
/*
-----------------------------------------------------------------------------
This source file is part of OGRE
(Object-oriented Graphics Rendering Engine)
For the latest info, see http://www.ogre3d.org/
Copyright (c) 2000-2013 Torus Knot Software Ltd
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-----------------------------------------------------------------------------
*/
#ifndef _OgreExternalTextureSource_H
#define _OgreExternalTextureSource_H
/***************************************************************************
OgreExternalTextureSource.h -
Base class that texture plugins need to derive from. This provides the hooks
necessary for a plugin developer to easily extend the functionality of dynamic textures.
It makes creation/destruction of dynamic textures more streamlined. While the plugin
will need to talk with Ogre for the actual modification of textures, this class allows
easy integration with Ogre apps. Material script files can be used to aid in the
creation of dynamic textures. Functionality can be added that is not defined here
through the use of the base dictionary. For an example of how to use this class and the
string interface see ffmpegVideoPlugIn.
-------------------
date : Jan 1 2004
email : pjcast@yahoo.com
***************************************************************************/
#include "OgreStringInterface.h"
#include "OgreResourceGroupManager.h"
#include "OgreHeaderPrefix.h"
namespace Ogre
{
enum eTexturePlayMode
{
TextureEffectPause = 0,
TextureEffectPlay_ASAP = 1,
TextureEffectPlay_Looping = 2
};
class _OgreExport ExternalTextureSource : public StringInterface
{
public:
ExternalTextureSource();
virtual ~ExternalTextureSource() {}
//------------------------------------------------------------------------------//
/* Command objects for specifying some base features */
/* Any Plugins wishing to add more specific params to "ExternalTextureSourcePlugins"*/
/* dictionary, feel free to do so, that's why this is here */
class _OgrePrivate CmdInputFileName : public ParamCommand
{
public:
String doGet(const void* target) const;
void doSet(void* target, const String& val);
};
class _OgrePrivate CmdFPS : public ParamCommand
{
public:
String doGet(const void* target) const;
void doSet(void* target, const String& val);
};
class _OgrePrivate CmdPlayMode : public ParamCommand
{
public:
String doGet(const void* target) const;
void doSet(void* target, const String& val);
};
class _OgrePrivate CmdTecPassState : public ParamCommand
{
public:
String doGet(const void* target) const;
void doSet(void* target, const String& val);
};
//--------------------------------------------------------//
//Base Functions that work with Command String Interface... Or can be called
//manually to create video through code
void setInputName( String sIN ) { mInputFileName = sIN; }
const String& getInputName( ) const { return mInputFileName; }
void setFPS( int iFPS ) { mFramesPerSecond = iFPS; }
int getFPS( ) const { return mFramesPerSecond; }
void setPlayMode( eTexturePlayMode eMode ) { mMode = eMode; }
eTexturePlayMode getPlayMode() const { return mMode; }
void setTextureTecPassStateLevel( int t, int p, int s )
{ mTechniqueLevel = t;mPassLevel = p;mStateLevel = s; }
void getTextureTecPassStateLevel( int& t, int& p, int& s ) const
{t = mTechniqueLevel; p = mPassLevel; s = mStateLevel;}
void addBaseParams();
const String& getPluginStringName( void ) const { return mPluginName; }
const String& getDictionaryStringName( void ) const { return mDictionaryName; }
//Pure virtual functions that plugins must Override
virtual bool initialise() = 0;
virtual void shutDown() = 0;
virtual void createDefinedTexture( const String& sMaterialName,
const String& groupName = ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME) = 0;
virtual void destroyAdvancedTexture( const String& sTextureName,
const String& groupName = ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME) = 0;
protected:
static CmdInputFileName msCmdInputFile;
static CmdFPS msCmdFramesPerSecond;
static CmdPlayMode msCmdPlayMode;
static CmdTecPassState msCmdTecPassState;
String mPluginName;
//------ Vars used for setting/getting dictionary stuff -----------//
eTexturePlayMode mMode;
String mInputFileName;
bool mUpdateEveryFrame;
int mFramesPerSecond,
mTechniqueLevel,
mPassLevel,
mStateLevel;
//------------------------------------------------------------------//
protected:
String mDictionaryName;
};
}
#include "OgreHeaderSuffix.h"
#endif
Ogre::ExternalTextureSource::getFPS
int getFPS() const
Gets currently set frames per second.
Definition: OgreExternalTextureSource.h:121
Ogre::ExternalTextureSource::CmdPlayMode
Definition: OgreExternalTextureSource.h:98
Ogre::ExternalTextureSource::mTechniqueLevel
int mTechniqueLevel
Definition: OgreExternalTextureSource.h:177
Ogre::ExternalTextureSource::CmdFPS
Definition: OgreExternalTextureSource.h:92
_OgreExport
#define _OgreExport
Definition: OgrePlatform.h:257
Ogre::ExternalTextureSource::msCmdPlayMode
static CmdPlayMode msCmdPlayMode
Command for setting frames per second.
Definition: OgreExternalTextureSource.h:163
Ogre::ExternalTextureSource::getTextureTecPassStateLevel
void getTextureTecPassStateLevel(int &t, int &p, int &s) const
Get currently selected Texture attribs.
Definition: OgreExternalTextureSource.h:131
Ogre::ExternalTextureSource::mUpdateEveryFrame
bool mUpdateEveryFrame
Definition: OgreExternalTextureSource.h:175
Ogre::TextureEffectPause
Definition: OgreExternalTextureSource.h:62
Ogre::ExternalTextureSource::CmdTecPassState
Definition: OgreExternalTextureSource.h:104
Ogre::TextureEffectPlay_ASAP
Video starts out paused.
Definition: OgreExternalTextureSource.h:63
Ogre::ExternalTextureSource::msCmdFramesPerSecond
static CmdFPS msCmdFramesPerSecond
Command for setting input file name.
Definition: OgreExternalTextureSource.h:162
Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME
static String DEFAULT_RESOURCE_GROUP_NAME
Default resource group name.
Definition: OgreResourceGroupManager.h:266
Ogre::TextureEffectPlay_Looping
Video starts playing as soon as possible.
Definition: OgreExternalTextureSource.h:64
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::eTexturePlayMode
eTexturePlayMode
Enum for type of texture play mode.
Definition: OgreExternalTextureSource.h:60
_OgrePrivate
#define _OgrePrivate
Definition: OgrePlatform.h:258
Ogre::ExternalTextureSource::mMode
eTexturePlayMode mMode
Definition: OgreExternalTextureSource.h:171
Ogre::ExternalTextureSource::setPlayMode
void setPlayMode(eTexturePlayMode eMode)
Sets a play mode.
Definition: OgreExternalTextureSource.h:123
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
Ogre::StringInterface
Class defining the common interface which classes can use to present a reflection-style, self-defining parameter set to callers.
Definition: OgreStringInterface.h:163
Ogre::String
_StringBase String
Definition: OgrePrerequisites.h:439
Ogre::ExternalTextureSource::getInputName
const String & getInputName() const
Gets currently set input file name.
Definition: OgreExternalTextureSource.h:117
Ogre::ExternalTextureSource::msCmdTecPassState
static CmdTecPassState msCmdTecPassState
Command for setting play mode.
Definition: OgreExternalTextureSource.h:164
OgreHeaderSuffix.h
Ogre::ExternalTextureSource::getPlayMode
eTexturePlayMode getPlayMode() const
Gets currently set play mode.
Definition: OgreExternalTextureSource.h:125
Ogre
Definition: OgreAndroidLogListener.h:34
Ogre::ExternalTextureSource::mInputFileName
String mInputFileName
Definition: OgreExternalTextureSource.h:173
Ogre::ExternalTextureSource::mDictionaryName
String mDictionaryName
The string name of the dictionary name - each plugin must override default name.
Definition: OgreExternalTextureSource.h:186
Ogre::ExternalTextureSource::~ExternalTextureSource
virtual ~ExternalTextureSource()
Virtual destructor.
Definition: OgreExternalTextureSource.h:80
Ogre::ExternalTextureSource::getDictionaryStringName
const String & getDictionaryStringName(void) const
Returns dictionary name.
Definition: OgreExternalTextureSource.h:140
OgreHeaderPrefix.h
Ogre::ExternalTextureSource::getPluginStringName
const String & getPluginStringName(void) const
Returns the string name of this Plugin (as set by the Plugin)
Definition: OgreExternalTextureSource.h:138
OgreResourceGroupManager.h
Ogre::ParamCommand
Abstract class which is command object which gets/sets parameters.
Definition: OgreStringInterface.h:79
Ogre::ExternalTextureSource
IMPORTANT: Plugins must override default dictionary name! Base class that texture plugins derive from...
Definition: OgreExternalTextureSource.h:74
Ogre::ExternalTextureSource::setInputName
void setInputName(String sIN)
Sets an input file name - if needed by plugin.
Definition: OgreExternalTextureSource.h:115
OgreStringInterface.h
Ogre::ExternalTextureSource::CmdInputFileName
Definition: OgreExternalTextureSource.h:86
Ogre::ExternalTextureSource::msCmdInputFile
static CmdInputFileName msCmdInputFile
Definition: OgreExternalTextureSource.h:161

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