00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #pragma once
00024
00025 #include <string>
00026 #include <OgreTexture.h>
00027 #include <OgreResource.h>
00028 #include "CanvasPrerequisites.h"
00029
00030 class _OgreCanvasExport DynamicTexture : public Ogre::ManualResourceLoader
00031 {
00032 public:
00033 DynamicTexture(const std::string& _textureName, unsigned int _width, unsigned int _height, bool _enableAlpha = true, int _mipmaps = 0);
00034 virtual ~DynamicTexture();
00035
00036 virtual void loadResource(Ogre::Resource* resource) = 0;
00037 void update(const Ogre::PixelBox& _box);
00038
00039 const std::string getName() const { return mName; }
00040 Ogre::TexturePtr getTexture() { return mTexture; }
00041 Ogre::PixelFormat getPixelFormat() { return mFormat; }
00042
00043 protected:
00044 void createTexture(void);
00045
00046 unsigned int mWidth;
00047 unsigned int mHeight;
00048 std::string mName;
00049 Ogre::PixelFormat mFormat;
00050 int mMipMaps;
00051 Ogre::TexturePtr mTexture;
00052 };