# Candera Engine 2D

#### Dirty Area Management

[Renderer2D::RenderCamera](http://dev.doc.cgistudio.at/APILINK/class_candera_1_1_renderer2_d.html#a44c76b6ec44f705ed78d71ca4f05b66b) now accepts a rectangle as the parameter that defines a dirty area. A dirty area denotes an area on the screen or render target in which the content has changed, thus only this area requires updating by the [Renderer](http://dev.doc.cgistudio.at/APILINK/class_candera_1_1_renderer.html "The class Renderer represents the unique Candera render interface to the application. Each render call an base of Candera shall be triggered via the Renderer interface."). The dirty area rectangle parameter defaults to the full size of the screen or render target. If the user provides his own dirty area rectangle, only this area will be cleared and drawn to. Objects whose bounding rectangle is outside the dirty area will be skipped. Generally speaking, the smaller the dirty area, the smaller the bandwidth required for clearing and drawing, and the more objects can be skipped.

This feature also adds the properties [Renderer2D::Statistics::BlitsCulled](http://dev.doc.cgistudio.at/APILINK/struct_candera_1_1_renderer2_d_1_1_statistics.html#a9c5d631131c9cf9f5b46c9fbd116a9a2 "Number of Blits that were culled, thus not submitted to the RenderDevice2D.") and [Renderer2D::Statistics::AverageDirtyAreaFactor](http://dev.doc.cgistudio.at/APILINK/struct_candera_1_1_renderer2_d_1_1_statistics.html#a1c7caace88e576ed72ff8d3aa9d9086f "Average dirty area factor (dirty area / renderTarget area) in the range of (0..1]."). BlitsCulled denotes the number of objects that could be skipped by the [Renderer](http://dev.doc.cgistudio.at/APILINK/class_candera_1_1_renderer.html "The class Renderer represents the unique Candera render interface to the application. Each render call an base of Candera shall be triggered via the Renderer interface.") due to their bounding rectangle being outside the dirty area. AverageDirtyAreaFactor denotes the average dirty area divided by the size of the screen or render target. E.g. a factor of 0.8 means that the average dirty area accumulated since the last [Renderer2D::Statistics::Reset](http://dev.doc.cgistudio.at/APILINK/struct_candera_1_1_renderer2_d_1_1_statistics.html#ac6f3f3b0a5ea14d2de26f4bd348c2c0c) is 80% of the size of the screen or render target. The bigger the factor, the less performance improvement can be expected. Under some circumstances, which depends on the actual content being used, performance can even decrease. Therefore always profile this feature to see if your content benefits from it or not.

<div class="contents" id="bkmrk-"><div class="contents"><div class="textblock">---

</div></div></div>#### Renderer2D::Statistics

[Renderer2D::Statistics](http://dev.doc.cgistudio.at/APILINK/struct_candera_1_1_renderer2_d_1_1_statistics.html) provides information on how many blits and clears were submitted to the RenderDevice2D in the process of executing [Renderer2D::RenderCamera](http://dev.doc.cgistudio.at/APILINK/class_candera_1_1_renderer2_d.html#a44c76b6ec44f705ed78d71ca4f05b66b) or [Renderer2D::RenderAllCameras](http://dev.doc.cgistudio.at/APILINK/class_candera_1_1_renderer2_d.html#aebe992159ee6bc5406b5c0feba870bb4). Furthermore the statistics keep track of how many blits could be culled by the [Renderer2D](http://dev.doc.cgistudio.at/APILINK/class_candera_1_1_renderer2_d.html "The class Renderer2D represents the unique Candera 2D render interface to the application. Each render call shall be triggered via the Renderer2D interface."), as well as the ratio of the average dirty area to its screen/render target area.

<div class="contents" id="bkmrk--0"><div class="textblock">---

</div></div>