DirectWrite and DirectX 11

Started by
6 comments, last by adrian_134 10 years, 9 months ago

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 ?

Advertisement

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

Maybe you can investigate this framework:

http://fw1.codeplex.com/

I personally use it, and it's great!

FastCall22: "I want to make the distinction that my laptop is a whore-box that connects to different network"

Blog about... stuff (GDNet, WordPress): www.gamedev.net/blog/1882-the-cuboid-zone/, cuboidzone.wordpress.com/

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

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

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 ?

any answer ?

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

This topic is closed to new replies.

Advertisement