1 // Copyright (C) 2013 Patryk Nadrowski
2 // Heavily based on the OpenGL driver implemented by Nikolaus Gebhardt
3 // OpenGL ES driver implemented by Christian Stehno and first OpenGL ES 2.0
4 // driver implemented by Amundis.
5 // This file is part of the "Irrlicht Engine".
6 // For conditions of distribution and use, see copyright notice in Irrlicht.h
7 
8 #ifndef __C_OGLES2_RENDERER_2D_H_INCLUDED__
9 #define __C_OGLES2_RENDERER_2D_H_INCLUDED__
10 
11 #include "IrrCompileConfig.h"
12 
13 #ifdef _IRR_COMPILE_WITH_OGLES2_
14 
15 #include "COGLES2MaterialRenderer.h"
16 
17 namespace irr
18 {
19 namespace video
20 {
21 
22 //! Class for renderer 2D in OpenGL ES 2.0
23 class COGLES2Renderer2D : public COGLES2MaterialRenderer
24 {
25 public:
26 	//! Constructor
27 	COGLES2Renderer2D(const c8* vertexShaderProgram, const c8* pixelShaderProgram, COGLES2Driver* driver);
28 
29 	//! Destructor
30 	~COGLES2Renderer2D();
31 
32 	virtual void OnSetMaterial(const SMaterial& material, const SMaterial& lastMaterial,
33 		bool resetAllRenderstates, IMaterialRendererServices* services);
34 
35 	virtual bool OnRender(IMaterialRendererServices* service, E_VERTEX_TYPE vtxtype);
36 
37 	void setTexture(const ITexture* texture);
38 
39 protected:
40 
41 	core::dimension2d<u32> RenderTargetSize;
42 	core::matrix4 Matrix;
43 
44 	const ITexture* Texture;
45 
46 	s32 MatrixID;
47 	s32 UseTextureID;
48 };
49 
50 
51 } // end namespace video
52 } // end namespace irr
53 
54 #endif
55 #endif
56 
57