Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Direct2D DrawText low performace


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 ThomasSquall   Members   -  Reputation: 104

Like
0Likes
Like

Posted 10 February 2014 - 01:00 AM

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, 10 February 2014 - 01:01 AM.


Sponsor:

#2 Erik Rufelt   Crossbones+   -  Reputation: 3519

Like
1Likes
Like

Posted 10 February 2014 - 01:06 AM

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.



#3 ThomasSquall   Members   -  Reputation: 104

Like
0Likes
Like

Posted 10 February 2014 - 01:37 AM

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






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS