MyGUI 3.2.2

MyGUI_RenderItem.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_ITEM_H_
8 #define MYGUI_RENDER_ITEM_H_
9
10 #include "MyGUI_Prerequest.h"
11 #include "MyGUI_ISubWidget.h"
12 #include "MyGUI_IVertexBuffer.h"
13 #include "MyGUI_VertexData.h"
14 #include "MyGUI_IRenderTarget.h"
15
16 namespace MyGUI
17 {
18
19 typedef std::pair<ISubWidget*, size_t> DrawItemInfo;
20 typedef std::vector<DrawItemInfo> VectorDrawItem;
21
22 class MYGUI_EXPORT RenderItem
23 {
24 public:
25 RenderItem();
26 virtual ~RenderItem();
27
28 void renderToTarget(IRenderTarget* _target, bool _update);
29
30 void setTexture(ITexture* _value);
31 ITexture* getTexture();
32
33 void setManualRender(bool _value);
34 bool getManualRender() const;
35
36 void addDrawItem(ISubWidget* _item, size_t _count);
37 void removeDrawItem(ISubWidget* _item);
38 void reallockDrawItem(ISubWidget* _item, size_t _count);
39
40 void outOfDate();
41 bool isOutOfDate() const;
42
43 size_t getNeedVertexCount() const;
44 size_t getVertexCount() const;
45
46 bool getCurrentUpdate() const;
47 Vertex* getCurrentVertexBuffer() const;
48
49 void setLastVertexCount(size_t _count);
50
51 IRenderTarget* getRenderTarget();
52
53 void setNeedCompression(bool _compression);
54 bool getNeedCompression() const;
55
56 private:
57 #if MYGUI_DEBUG_MODE == 1
58 std::string mTextureName;
59 #endif
60
61 ITexture* mTexture;
62
63 size_t mNeedVertexCount;
64
65 bool mOutOfDate;
66 VectorDrawItem mDrawItems;
67
68 // колличество отрендренных реально вершин
69 size_t mCountVertex;
70
71 bool mCurrentUpdate;
72 Vertex* mCurrentVertex;
73 size_t mLastVertexCount;
74
75 IVertexBuffer* mVertexBuffer;
76 IRenderTarget* mRenderTarget;
77
78 bool mNeedCompression;
79 bool mManualRender;
80 };
81
82 } // namespace MyGUI
83
84 #endif // MYGUI_RENDER_ITEM_H_
MyGUI_VertexData.h
MyGUI_IVertexBuffer.h
MyGUI_Prerequest.h
MyGUI_IRenderTarget.h
MyGUI::DrawItemInfo
std::pair< ISubWidget *, size_t > DrawItemInfo
Definition: MyGUI_RenderItem.h:19
MyGUI::RenderItem
Definition: MyGUI_RenderItem.h:22
MyGUI::IVertexBuffer
Definition: MyGUI_IVertexBuffer.h:16
MyGUI::ISubWidget
Definition: MyGUI_ISubWidget.h:24
MyGUI
Definition: MyGUI_ActionController.h:14
MYGUI_EXPORT
#define MYGUI_EXPORT
Definition: MyGUI_Platform.h:103
MyGUI::ITexture
Definition: MyGUI_ITexture.h:26
MyGUI::IRenderTarget
Definition: MyGUI_IRenderTarget.h:20
MyGUI::VectorDrawItem
std::vector< DrawItemInfo > VectorDrawItem
Definition: MyGUI_RenderItem.h:20
MyGUI_ISubWidget.h
MyGUI::Vertex
Definition: MyGUI_VertexData.h:16