MyGUI: MyGUI_ITexture.h Source File

MyGUI 3.2.2

MyGUI_ITexture.h
Go to the documentation of this file.
1 /*
2 * This source file is part of MyGUI. For the latest info, see http://mygui.info/
3 * Distributed under the MIT License
4 * (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
5 */
6
7 #ifndef MYGUI_I_TEXTURE_H_
8 #define MYGUI_I_TEXTURE_H_
9
10 #include "MyGUI_Prerequest.h"
11 #include "MyGUI_IRenderTarget.h"
12 #include "MyGUI_RenderFormat.h"
13 #include <string>
14
15 namespace MyGUI
16 {
17 class ITexture;
18
19 class MYGUI_EXPORT ITextureInvalidateListener
20 {
21 public:
22 virtual ~ITextureInvalidateListener() { }
23 virtual void textureInvalidate(ITexture* _texture) = 0;
24 };
25
26 class MYGUI_EXPORT ITexture
27 {
28 public:
29 virtual ~ITexture() { }
30
31 virtual const std::string& getName() const = 0;
32
33 virtual void createManual(int _width, int _height, TextureUsage _usage, PixelFormat _format) = 0;
34 virtual void loadFromFile(const std::string& _filename) = 0;
35 virtual void saveToFile(const std::string& _filename) = 0;
36
37 virtual void setInvalidateListener(ITextureInvalidateListener* _listener) { }
38
39 virtual void destroy() = 0;
40
41 virtual void* lock(TextureUsage _access) = 0;
42 virtual void unlock() = 0;
43 virtual bool isLocked() = 0;
44
45 virtual int getWidth() = 0;
46 virtual int getHeight() = 0;
47
48 virtual PixelFormat getFormat() = 0;
49 virtual TextureUsage getUsage() = 0;
50 virtual size_t getNumElemBytes() = 0;
51
52 virtual IRenderTarget* getRenderTarget()
53 {
54 return nullptr;
55 }
56 };
57
58 } // namespace MyGUI
59
60 #endif // MYGUI_I_TEXTURE_H_
MyGUI::ITexture::setInvalidateListener
virtual void setInvalidateListener(ITextureInvalidateListener *_listener)
Definition: MyGUI_ITexture.h:37
MyGUI_RenderFormat.h
MyGUI::ITextureInvalidateListener::~ITextureInvalidateListener
virtual ~ITextureInvalidateListener()
Definition: MyGUI_ITexture.h:22
MyGUI_Prerequest.h
MyGUI::ITextureInvalidateListener
Definition: MyGUI_ITexture.h:19
MyGUI::ITexture::~ITexture
virtual ~ITexture()
Definition: MyGUI_ITexture.h:29
MyGUI_IRenderTarget.h
MyGUI::ITexture::getRenderTarget
virtual IRenderTarget * getRenderTarget()
Definition: MyGUI_ITexture.h:52
MyGUI::ITexture
Definition: MyGUI_ITexture.h:26
MYGUI_EXPORT
#define MYGUI_EXPORT
Definition: MyGUI_Platform.h:103
MyGUI::PixelFormat
Definition: MyGUI_RenderFormat.h:49
MyGUI
Definition: MyGUI_ActionController.h:14
MyGUI::IRenderTarget
Definition: MyGUI_IRenderTarget.h:20
MyGUI::TextureUsage
Definition: MyGUI_RenderFormat.h:84