MyGUI 3.5.3
MyGUI_RenderManager.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_RENDER_MANAGER_H_
8#define MYGUI_RENDER_MANAGER_H_
9
10#include "MyGUI_Prerequest.h"
11#include "MyGUI_Singleton.h"
12#include "MyGUI_RenderFormat.h"
13#include "MyGUI_ITexture.h"
14#include "MyGUI_IVertexBuffer.h"
15#include "MyGUI_IRenderTarget.h"
16
17#include <unordered_map>
18
19namespace MyGUI
20{
21
22 class MYGUI_EXPORT RenderManager
23 {
24 MYGUI_SINGLETON_DECLARATION(RenderManager);
25
26 public:
27 RenderManager();
28 virtual ~RenderManager() = default;
29
34 virtual IVertexBuffer* createVertexBuffer() = 0;
36 virtual void destroyVertexBuffer(IVertexBuffer* _buffer) = 0;
37
39 virtual ITexture* createTexture(const std::string& _name) = 0;
41 virtual void destroyTexture(ITexture* _texture) = 0;
43 virtual ITexture* getTexture(const std::string& _name) = 0;
44
46 const IntSize& getTextureSize(const std::string& _name, bool _cache = true);
47
48 //FIXME: possibly move to render target structure
49 virtual const IntSize& getViewSize() const = 0;
50
52 virtual VertexColourType getVertexFormat() const = 0;
53
55 virtual bool isFormatSupported(PixelFormat _format, TextureUsage _usage);
56
58 virtual void setViewSize(int _width, int _height) = 0;
59
63 virtual void registerShader(
64 const std::string& _shaderName,
65 const std::string& _vertexProgramFile,
66 const std::string& _fragmentProgramFile) = 0;
67
69 virtual bool checkTexture(ITexture* _texture);
70
71 protected:
72 virtual void onResizeView(const IntSize& _viewSize);
73 virtual void onRenderToTarget(IRenderTarget* _target, bool _update);
74 virtual void onFrameEvent(float _time);
75
76 private:
77 std::unordered_map<std::string, IntSize> mTextureSizes;
78 };
79
80} // namespace MyGUI
81
82#endif // MYGUI_RENDER_MANAGER_H_
#define MYGUI_EXPORT
#define MYGUI_SINGLETON_DECLARATION(ClassName)
const IntSize & getTextureSize(const std::string &_texture, bool _cache)
types::TSize< int > IntSize
Definition MyGUI_Types.h:29