MyGUI: MyGUI_RenderItem.h Source File

MyGUI 3.4.3

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
16namespace MyGUI
17{
18
19 using DrawItemInfo = std::pair<ISubWidget*, size_t>;
20 using VectorDrawItem = std::vector<DrawItemInfo>;
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() const;
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 ITexture* mTexture{nullptr};
58
59 size_t mNeedVertexCount{0};
60
61 bool mOutOfDate{false};
62 VectorDrawItem mDrawItems;
63
64 // колличество отрендренных реально вершин
65 size_t mCountVertex{0};
66
67 bool mCurrentUpdate{true};
68 Vertex* mCurrentVertex{nullptr};
69 size_t mLastVertexCount{0};
70
71 IVertexBuffer* mVertexBuffer{nullptr};
72 IRenderTarget* mRenderTarget{nullptr};
73
74 bool mNeedCompression{false};
75 bool mManualRender{false};
76 };
77
78} // namespace MyGUI
79
80#endif // MYGUI_RENDER_ITEM_H_
MyGUI_IRenderTarget.h
MyGUI_ISubWidget.h
MyGUI_IVertexBuffer.h
MYGUI_EXPORT
#define MYGUI_EXPORT
Definition MyGUI_Platform.h:77
MyGUI_Prerequest.h
MyGUI_VertexData.h
MyGUI::IRenderTarget
Definition MyGUI_IRenderTarget.h:21
MyGUI::ISubWidget
Definition MyGUI_ISubWidget.h:25
MyGUI::ITexture
Definition MyGUI_ITexture.h:28
MyGUI::IVertexBuffer
Definition MyGUI_IVertexBuffer.h:17
MyGUI::RenderItem::addDrawItem
void addDrawItem(ISubWidget *_item, size_t _count)
Definition MyGUI_RenderItem.cpp:112
MyGUI::RenderItem::getCurrentUpdate
bool getCurrentUpdate() const
Definition MyGUI_RenderItem.cpp:207
MyGUI::RenderItem::setManualRender
void setManualRender(bool _value)
Definition MyGUI_RenderItem.cpp:177
MyGUI::RenderItem::setTexture
void setTexture(ITexture *_value)
Definition MyGUI_RenderItem.cpp:151
MyGUI::RenderItem::getRenderTarget
IRenderTarget * getRenderTarget()
Definition MyGUI_RenderItem.cpp:222
MyGUI::RenderItem::renderToTarget
void renderToTarget(IRenderTarget *_target, bool _update)
Definition MyGUI_RenderItem.cpp:29
MyGUI::RenderItem::RenderItem
RenderItem()
Definition MyGUI_RenderItem.cpp:18
MyGUI::RenderItem::getManualRender
bool getManualRender() const
Definition MyGUI_RenderItem.cpp:182
MyGUI::RenderItem::getVertexCount
size_t getVertexCount() const
Definition MyGUI_RenderItem.cpp:202
MyGUI::RenderItem::getNeedCompression
bool getNeedCompression() const
Definition MyGUI_RenderItem.cpp:172
MyGUI::RenderItem::isOutOfDate
bool isOutOfDate() const
Definition MyGUI_RenderItem.cpp:192
MyGUI::RenderItem::outOfDate
void outOfDate()
Definition MyGUI_RenderItem.cpp:187
MyGUI::RenderItem::setNeedCompression
void setNeedCompression(bool _compression)
Definition MyGUI_RenderItem.cpp:167
MyGUI::RenderItem::reallockDrawItem
void reallockDrawItem(ISubWidget *_item, size_t _count)
Definition MyGUI_RenderItem.cpp:129
MyGUI::RenderItem::getNeedVertexCount
size_t getNeedVertexCount() const
Definition MyGUI_RenderItem.cpp:197
MyGUI::RenderItem::removeDrawItem
void removeDrawItem(ISubWidget *_item)
Definition MyGUI_RenderItem.cpp:87
MyGUI::RenderItem::getCurrentVertexBuffer
Vertex * getCurrentVertexBuffer() const
Definition MyGUI_RenderItem.cpp:212
MyGUI::RenderItem::getTexture
ITexture * getTexture() const
Definition MyGUI_RenderItem.cpp:162
MyGUI::RenderItem::setLastVertexCount
void setLastVertexCount(size_t _count)
Definition MyGUI_RenderItem.cpp:217
MyGUI
Definition MyGUI_ActionController.h:15
MyGUI::VectorDrawItem
std::vector< DrawItemInfo > VectorDrawItem
Definition MyGUI_RenderItem.h:20
MyGUI::DrawItemInfo
std::pair< ISubWidget *, size_t > DrawItemInfo
Definition MyGUI_RenderItem.h:19
MyGUI::Vertex
Definition MyGUI_VertexData.h:17