File: MyGUI_ExportRenderManager.h

package info (click to toggle)
mygui 3.2.2%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 36,224 kB
  • sloc: cpp: 118,031; ansic: 30,202; xml: 15,544; cs: 12,602; tcl: 776; python: 417; makefile: 34
file content (92 lines) | stat: -rw-r--r-- 2,438 bytes parent folder | download | duplicates (4)
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
89
90
91
92
/*!
	@file
	@author		Albert Semenov
	@date		08/2012
*/

#ifndef _1fa6ce0c_1576_452a_98d8_ac49ed9e38d1_
#define _1fa6ce0c_1576_452a_98d8_ac49ed9e38d1_

#include "MyGUI_Prerequest.h"
#include "MyGUI_RenderFormat.h"
#include "MyGUI_RenderManager.h"
#include "MyGUI_ExportTexture.h"
#include "MyGUI_ExportVertexBuffer.h"
#include "RenderBatchInfo.h"

namespace MyGUI
{

	class ExportRenderManager :
		public RenderManager,
		public IRenderTarget
	{
	public:
		ExportRenderManager();

		void initialise();
		void shutdown();

		static ExportRenderManager& getInstance();
		static ExportRenderManager* getInstancePtr();

		/** @see RenderManager::getViewSize */
		virtual const IntSize& getViewSize() const;

		/** @see RenderManager::getVertexFormat */
		virtual VertexColourType getVertexFormat();

		/** @see RenderManager::createVertexBuffer */
		virtual IVertexBuffer* createVertexBuffer();
		/** @see RenderManager::destroyVertexBuffer */
		virtual void destroyVertexBuffer(IVertexBuffer* _buffer);

		/** @see RenderManager::createTexture */
		virtual ITexture* createTexture(const std::string& _name);
		/** @see RenderManager::destroyTexture */
		virtual void destroyTexture(ITexture* _texture);
		/** @see RenderManager::getTexture */
		virtual ITexture* getTexture(const std::string& _name);

		/** @see RenderManager::isFormatSupported */
		virtual bool isFormatSupported(PixelFormat _format, TextureUsage _usage);

		/** @see IRenderTarget::begin */
		virtual void begin();
		/** @see IRenderTarget::end */
		virtual void end();

		/** @see IRenderTarget::doRender */
		virtual void doRender(IVertexBuffer* _buffer, ITexture* _texture, size_t _count);

		/** @see IRenderTarget::getInfo */
		virtual const RenderTargetInfo& getInfo();

		/*internal:*/
		void drawOneFrame();
		void setViewSize(int _width, int _height);

		RenderBatchInfo* getBatchInfo(size_t _index);
		void addTexture(const std::string& _name, size_t _id, int _width, int _height);

		void doRenderLayer(ILayer* _layer);

	private:
		void destroyAllTextures();

	private:
		IntSize mViewSize;
		RenderTargetInfo mInfo;
		typedef std::map<std::string, ExportTexture*> MapTexture;
		MapTexture mTextures;
		bool mUpdate;
		typedef std::vector<RenderBatchInfo> VectorBatchInfo;
		VectorBatchInfo mBatchInfo;
		typedef std::vector<ExportVertexBuffer*> VectorExportVertexBuffer;
		VectorExportVertexBuffer mExportVertexBuffer;
		ILayer* mCurrentLayer;
	};

}

#endif