MyGUI  3.2.1
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 
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  bool getCompression();
54 
55  private:
56 #if MYGUI_DEBUG_MODE == 1
57  std::string mTextureName;
58 #endif
59 
60  ITexture* mTexture;
61 
62  size_t mNeedVertexCount;
63 
64  bool mOutOfDate;
65  VectorDrawItem mDrawItems;
66 
67  // колличество отрендренных реально вершин
68  size_t mCountVertex;
69 
70  bool mCurrentUpdate;
71  Vertex* mCurrentVertex;
72  size_t mLastVertexCount;
73 
74  IVertexBuffer* mVertexBuffer;
75  IRenderTarget* mRenderTarget;
76 
77  bool mCompression;
78  bool mManualRender;
79  };
80 
81 } // namespace MyGUI
82 
83 #endif // __MYGUI_RENDER_ITEM_H__