File: MyGUI_RTTLayerNode.h

package info (click to toggle)
mygui 3.4.3%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 38,792 kB
  • sloc: cpp: 133,849; ansic: 30,249; xml: 15,794; cs: 12,601; tcl: 776; python: 400; makefile: 35; sh: 4
file content (88 lines) | stat: -rw-r--r-- 1,779 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/*!
	@file
	@author		Albert Semenov
	@date		02/2008
*/

#ifndef MYGUI_RTT_LAYER_NODE_H_
#define MYGUI_RTT_LAYER_NODE_H_

#include "MyGUI_Prerequest.h"
#include "MyGUI_LayerNode.h"
#include "MyGUI_ITexture.h"
#include "MyGUI_LayerNodeAnimation.h"
#include <MyGUI_Timer.h>

namespace MyGUI
{

	class /*MYGUI_EXPORT */ RTTLayerNode : public LayerNode
	{
		MYGUI_RTTI_DERIVED(RTTLayerNode)

	public:
		explicit RTTLayerNode(ILayer* _layer, ILayerNode* _parent = nullptr);
		~RTTLayerNode() override;

		// необходимо обновление нода
		void outOfDate(RenderItem* _item) override;

		// добавляем айтем к ноду
		void attachLayerItem(ILayerItem* _item) override;
		// удаляем айтем из нода
		void detachLayerItem(ILayerItem* _item) override;

		// рисует леер
		void renderToTarget(IRenderTarget* _target, bool _update) override;

		bool getCacheUsing() const
		{
			return mChacheUsing;
		}
		void setCacheUsing(bool _value);

		bool getAnimate() const
		{
			return mIsAnimate;
		}

		void setDestroy(bool _value)
		{
			mDestroy = _value;
		}
		bool getDestroy() const
		{
			return mDestroy;
		}

		void addLayerNodeAnimation(LayerNodeAnimation* _impl);

	private:
		void checkTexture();

	private:
		IVertexBuffer* mVertexBuffer{nullptr};
		ITexture* mTexture{nullptr};

		IntSize mTextureSize;
		IntCoord mCurrentCoord;

		bool mOutOfDateRtt{false};

		bool mMajorUpdate{false};
		bool mChacheUsing{true};
		bool mDestroy{false};
		bool mIsAnimate{false};

		using VectorLayerNodeAnimation = std::vector<LayerNodeAnimation*>;
		VectorLayerNodeAnimation mLayerNodeAnimation;

		VectorQuadData mData;
		QuadData mDefaultData;

		MyGUI::Timer mTimer;
	};

} // namespace MyGUI

#endif // MYGUI_RTT_LAYER_NODE_H_