1 // Copyright (C) 2015 Patryk Nadrowski
\r
2 // This file is part of the "Irrlicht Engine".
\r
3 // For conditions of distribution and use, see copyright notice in irrlicht.h
\r
5 #ifndef __I_RENDER_TARGET_H_INCLUDED__
\r
6 #define __I_RENDER_TARGET_H_INCLUDED__
\r
8 #include "IReferenceCounted.h"
\r
9 #include "EDriverTypes.h"
\r
10 #include "irrArray.h"
\r
18 //! Enumeration of cube texture surfaces
\r
29 //! Interface of a Render Target.
\r
30 class IRenderTarget : public virtual IReferenceCounted
\r
35 IRenderTarget() : DepthStencil(0), DriverType(EDT_NULL)
\r
39 //! Returns an array of previously set textures.
\r
40 const core::array<ITexture*>& getTexture() const
\r
45 //! Returns a of previously set depth / depth-stencil texture.
\r
46 ITexture* getDepthStencil() const
\r
48 return DepthStencil;
\r
51 //! Set multiple textures.
\r
52 /** Set multiple textures for the render target.
\r
53 \param texture Array of texture objects. These textures are used for a color outputs.
\r
54 \param depthStencil Depth or packed depth-stencil texture. This texture is used as depth
\r
55 or depth-stencil buffer.
\r
56 \param cubeSurfaces When rendering to cube textures, set the surface to be used for each texture. Can be empty otherwise.
\r
58 virtual void setTexture(const core::array<ITexture*>& texture, ITexture* depthStencil, const core::array<E_CUBE_SURFACE>& cubeSurfaces = core::array<E_CUBE_SURFACE>()) = 0;
\r
60 //! Set one texture.
\r
61 void setTexture(ITexture* texture, ITexture* depthStencil)
\r
63 core::array<ITexture*> textureArray(1);
\r
64 textureArray.push_back(texture);
\r
66 setTexture(textureArray, depthStencil);
\r
69 //! Set one cube surface texture.
\r
70 void setTexture(ITexture* texture, ITexture* depthStencil, E_CUBE_SURFACE cubeSurface)
\r
72 core::array<ITexture*> textureArray(1);
\r
73 textureArray.push_back(texture);
\r
75 core::array<E_CUBE_SURFACE> cubeSurfaces(1);
\r
76 cubeSurfaces.push_back(cubeSurface);
\r
78 setTexture(textureArray, depthStencil, cubeSurfaces);
\r
81 //! Get driver type of render target.
\r
82 E_DRIVER_TYPE getDriverType() const
\r
89 //! Textures assigned to render target.
\r
90 core::array<ITexture*> Texture;
\r
92 //! Depth or packed depth-stencil texture assigned to render target.
\r
93 ITexture* DepthStencil;
\r
95 //! Active surface of cube textures
\r
96 core::array<E_CUBE_SURFACE> CubeSurfaces;
\r
98 //! Driver type of render target.
\r
99 E_DRIVER_TYPE DriverType;
\r
102 // no copying (IReferenceCounted still allows that for reasons which take some time to work around)
\r
103 IRenderTarget(const IRenderTarget&);
\r
104 IRenderTarget& operator=(const IRenderTarget&);
\r