Nirtcpp 2.1.0
Nirtcpp is a high-performance c++ graphics engine.
Loading...
Searching...
No Matches
IRenderTarget.hpp
1// Copyright (C) 2015 Patryk Nadrowski
2// This file is part of the "Irrlicht Engine".
3// For conditions of distribution and use, see copyright notice in nirtcpp/nirtcpp.hpp
4
5#ifndef NIRT_I_RENDER_TARGET_HPP_INCLUDED
6#define NIRT_I_RENDER_TARGET_HPP_INCLUDED
7
8#include <nirtcpp/core/engine/IReferenceCounted.hpp>
9#include <nirtcpp/core/engine/EDriverTypes.hpp>
10#include <nirtcpp/core/engine/irrArray.hpp>
11
12namespace nirt
13{
14namespace video
15{
16 class ITexture;
17
20 {
21 ECS_POSX = 0,
22 ECS_NEGX,
23 ECS_POSY,
24 ECS_NEGY,
25 ECS_POSZ,
26 ECS_NEGZ
27 };
28
30 class IRenderTarget : public virtual IReferenceCounted
31 {
32 public:
33
38
41 {
42 return Textures;
43 }
44
47 {
48 return DepthStencil;
49 }
50
53 {
54 return CubeSurfaces;
55 }
56
58
64 void setTexture(const core::array<ITexture*>& texture, ITexture* depthStencil, const core::array<E_CUBE_SURFACE>& cubeSurfaces = core::array<E_CUBE_SURFACE>())
65 {
66 setTextures(texture.const_pointer(), texture.size(), depthStencil, cubeSurfaces.const_pointer(), cubeSurfaces.size());
67 }
68
71 void setTexture(ITexture* texture, ITexture* depthStencil)
72 {
73 if ( texture )
74 {
75 setTextures(&texture, 1, depthStencil);
76 }
77 else
78 {
79 setTextures(0, 0, depthStencil);
80 }
81 }
82
84 void setTexture(ITexture* texture, ITexture* depthStencil, E_CUBE_SURFACE cubeSurface)
85 {
86 if ( texture )
87 {
88 setTextures(&texture, 1, depthStencil, &cubeSurface, 1);
89 }
90 else
91 {
92 setTextures(0, 0, depthStencil, &cubeSurface, 1);
93 }
94 }
95
98 {
99 return DriverType;
100 }
101
102 protected:
103
105 // NOTE: working with pointers instead of arrays to avoid unnecessary memory allocations for the single textures case
106 virtual void setTextures(ITexture* const * textures, u32 numTextures, ITexture* depthStencil, const E_CUBE_SURFACE* cubeSurfaces=0, u32 numCubeSurfaces=0) = 0;
107
110
113
116
119
120 private:
121 // no copying (IReferenceCounted still allows that for reasons which take some time to work around)
123 IRenderTarget& operator=(const IRenderTarget&);
124 };
125
126}
127}
128
129#endif
Base class of most objects of the Nirtcpp Engine.
Definition IReferenceCounted.hpp:46
Axis aligned bounding box in 3d dimensional space.
Definition aabbox3d.hpp:22
Interface of a Render Target.
Definition IRenderTarget.hpp:31
virtual void setTextures(ITexture *const *textures, u32 numTextures, ITexture *depthStencil, const E_CUBE_SURFACE *cubeSurfaces=0, u32 numCubeSurfaces=0)=0
Set multiple textures.
core::array< ITexture * > Textures
Textures assigned to render target.
Definition IRenderTarget.hpp:109
void setTexture(ITexture *texture, ITexture *depthStencil, E_CUBE_SURFACE cubeSurface)
Set one cube surface texture.
Definition IRenderTarget.hpp:84
ITexture * DepthStencil
Depth or packed depth-stencil texture assigned to render target.
Definition IRenderTarget.hpp:112
const core::array< E_CUBE_SURFACE > & getCubeSurfaces() const
Returns an array of active surface for cube textures.
Definition IRenderTarget.hpp:52
void setTexture(const core::array< ITexture * > &texture, ITexture *depthStencil, const core::array< E_CUBE_SURFACE > &cubeSurfaces=core::array< E_CUBE_SURFACE >())
Set multiple textures.
Definition IRenderTarget.hpp:64
core::array< E_CUBE_SURFACE > CubeSurfaces
Active surface of cube textures.
Definition IRenderTarget.hpp:115
E_DRIVER_TYPE DriverType
Driver type of render target.
Definition IRenderTarget.hpp:118
void setTexture(ITexture *texture, ITexture *depthStencil)
Definition IRenderTarget.hpp:71
E_DRIVER_TYPE getDriverType() const
Get driver type of render target.
Definition IRenderTarget.hpp:97
ITexture * getDepthStencil() const
Returns a of previously set depth / depth-stencil texture.
Definition IRenderTarget.hpp:46
const core::array< ITexture * > & getTexture() const
Returns an array of previously set textures.
Definition IRenderTarget.hpp:40
IRenderTarget()
constructor
Definition IRenderTarget.hpp:35
Interface of a Video Driver dependent Texture.
Definition ITexture.hpp:186
E_CUBE_SURFACE
Enumeration of cube texture surfaces.
Definition IRenderTarget.hpp:20
E_DRIVER_TYPE
An enum for all types of drivers the Nirtcpp Engine supports.
Definition EDriverTypes.hpp:17
@ EDT_NULL
Null driver, useful for applications to run the engine without visualization.
Definition EDriverTypes.hpp:21
As of Nirtcpp 1.6, position2d is a synonym for vector2d.
Definition vector3d.hpp:11
unsigned int u32
32 bit unsigned variable.
Definition irrTypes.hpp:64

Nirtcpp    @cppfx.xyz

Esvcpp    esv::print