Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualxoofx

Posted 23 November 2012 - 07:28 PM

Avoid creating resource when rendering (avoid CreateSolidColorBrush in a rendering loop).
Also DrawText is absolutely not performance oriented to draw dynamic strings, d2d and dwrite has to calculate the whole vertex buffers of these strings at runtime. If you have 5000 dynamic strings, I would use a SpriteFont bitmap approach instead. If these strings are mostly static, use TextLayout instead whenever it is possible (the vertex layout is precalculated at creation time).
Oh, also, D2D is a batch API, a batch is done between a pair of Begin/End. Calling DrawText between each Begin/End is going to hurt a *lot* the batching (well, you will have no batching). The recommended usage is perform mostly a single Begin/End for the whole rendering of a render pass, and perform all your drawing between this Begin/End pair.

#4xoofx

Posted 23 November 2012 - 07:26 PM

Avoid creating resource when rendering (avoid CreateSolidColorBrush in a rendering loop).
Also DrawText is absolutely not performance oriented to draw dynamic strings, d2d and dwrite has to calculate the whole vertex buffers of these strings at runtime. If you have 5000 dynamic strings, I would use a SpriteFont bitmap approach instead. If these strings are mostly static, use TextLayout instead whenever it is possible (the vertex layout is precalculated at creation time).

#3xoofx

Posted 23 November 2012 - 07:25 PM

Avoid creating resource when rendering (avoid CreateSolidColorBrush in a rendering loop).
Also DrawText is absolutely not performance oriented to draw dynamic strings, d2d and dwrite has to calculate the whole vertex buffers of these strings at runtime. If you have 5000 dynamic strings, I would use a SpriteFont bitmap approach instead. If in you strings, there are static strings, use TextLayout instead whenever it is possible (the vertex layout is precalculated at creation time).

#2xoofx

Posted 23 November 2012 - 07:25 PM

Avoid creating resource when rendering (avoid CreateSolidColorBrush in a rendering loop).
Also DrawText is absolutely not performance oriented to draw dynamic strings, d2d and dwrite has to calculate the whole vertex layout of these strings at runtime. If you have 5000 dynamic strings, I would use a SpriteFont bitmap approach instead. If in you strings, there are static strings, use TextLayout instead whenever it is possible (the vertex layout is precalculated at creation time).

#1xoofx

Posted 23 November 2012 - 07:25 PM

Avoid creating resource when rendering (avoid CreateSolidColorBrush in a rendering loop).
Also DrawText is absolutely not performance oriented to draw dynamic strings, d2d and dwrite as to calculate the whole vertex layout of these strings at runtime. If you have 5000 dynamic strings, I would use a SpriteFont bitmap approach instead. If in you strings, there are static strings, use TextLayout instead whenever it is possible (the vertex layout is precalculated at creation time).

PARTNERS