Jump to content

  • Log In with Google      Sign In   
  • Create Account

DirectWrite and DirectX 11


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
7 replies to this topic

#1 adrian_134   Members   -  Reputation: 120

Like
0Likes
Like

Posted 29 June 2013 - 07:59 AM

Hi!

 

How i can connect DirectWrite and DirectX 11, I want to render text to directx surface and use this texture as bitmap font ? I can't find  any tutorial about this. I must draw text in WM_PAINT message but is this only one way to do this ?



Sponsor:

#2 shazen   Members   -  Reputation: 282

Like
0Likes
Like

Posted 29 June 2013 - 08:32 AM

The directX tool kit (DirectXTK ) has easy to use text functionality that works with directx 11. I'm not sure it will be your solution but it works both in a windows directX 11 application and the new windows RT apps

 

http://code.msdn.microsoft.com/windowsapps/DirectXTK-Simple-Sample-608bc274



#3 Migi0027   Crossbones+   -  Reputation: 1727

Like
0Likes
Like

Posted 29 June 2013 - 02:59 PM

Maybe you can investigate this framework:

 

http://fw1.codeplex.com/

 

I personally use it, and it's great!


Hi! Cuboid Zone
The Rule: Be polite, be professional, but have a plan to kill everyone you meet, ohh, AND STEAL ALL ZE TRIANGLES FROM ZHEM!

#4 adrian_134   Members   -  Reputation: 120

Like
0Likes
Like

Posted 01 July 2013 - 11:04 AM

Maybe you can investigate this framework:

 

http://fw1.codeplex.com/

 

I personally use it, and it's great!

Yes, i know something about this, but i want to write my library to doing this but i dont know how i can do it. I look at source of this library and i cant understand how it's working



#5 Mike.Popoloski   Crossbones+   -  Reputation: 2911

Like
1Likes
Like

Posted 01 July 2013 - 01:55 PM

It's a fairly straightforward concept, just lots of moving parts to deal with. Essentially you implement a custom ITextRenderer interface and plug it into DirectWrite, so the dwrite text layout engine says "here are the glyphs you want, and here is where you should put them".  Then it's up to you to render them at those spots. 

 

That library uses another piece of DWrite, a BitmapRenderTarget, to render each glyph to a memory buffer and then packs it into a Direct3D texture atlas using a bin packing algorithm. Then you have a texture atlas with various rendered glyphs, and you have positioning info, so you can just draw quads at those spots with the correct texture coordinates and it all works.


Mike Popoloski | Journal | SlimDX

#6 adrian_134   Members   -  Reputation: 120

Like
0Likes
Like

Posted 02 July 2013 - 08:54 AM

That library uses another piece of DWrite, a BitmapRenderTarget, to render each glyph to a memory buffer and then packs it into a Direct3D texture atlas using a bin packing algorithm. Then you have a texture atlas with various rendered glyphs, and you have positioning info, so you can just draw quads at those spots with the correct texture coordinates and it all works.

And i want to do that on this method, but i still have a few question, the first is: I can draw text with DirectWrite in other place than winapi message WM_PAINT ? I can do this in render function ? And how i can copy BitmapRenderTarget to Direct3D texture ?



#7 adrian_134   Members   -  Reputation: 120

Like
0Likes
Like

Posted 04 July 2013 - 02:38 PM

any answer ?



#8 adrian_134   Members   -  Reputation: 120

Like
0Likes
Like

Posted 12 July 2013 - 10:50 AM

I don't have any answer becouse this is very simple or it's impossible to do it ?






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