• Advertisement
Sign in to follow this  

Direct2D DrawText low performace

This topic is 1443 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I eveybody, this is my first post on this forum so I'm nice to meet you, I'm Thomas and I'm a 22 years old programmer, expert on C# but newbie on C++. Now my problem:

I've a directx11 game engine that use an ID3DDevice to draw textures, but to draw fonts I've shared surface between a ID3D10Device1 and my main device, so I'm able to draw text throug Direct2D and DirectWrite, my problem is that every text that I use to draw slows my application very much, profiling I've noticed that the problem is the call to the DrawText function of my ID2DRendertTarget that is defined inside d2d1.dll, any suggests?

Edited by ThomasSquall

Share this post


Link to post
Share on other sites
Advertisement

Cache the strings or character-glyphs to a texture and draw your text with textured quad(s).

 

However, it shouldn't be that slow with D2D.. though it depends on how much text you draw and possibly other things. Approximately how many characters do you draw each frame, and how many ms does it add to your frame-time?

Does it make a difference if you draw 1 character or 1000?

Just to determine if the problem is in using D2D at all or in the work it does when drawing glyphs.

Share this post


Link to post
Share on other sites

Thanks for reply, I've tried to leave all code and comment the d2dRender->DrawText(...) and the framerate has came back to normality and you're right, it's not depending on the number of string but on the number of character that I draw, I've tried add like 30 characters and it is really slowered down to much

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement