tags:

views:

97

answers:

1

I'm creating an application overlay via Direct3D hooking, however I can't draw any text. I've started with this sample. The library itself seems to replace all D3D calls with own functions (and in the end it calls the original ones). I've tried all variations of DrawText without any result visible result. On the other hand, I can draw primitives with DrawPrimitiveUP. Also, the DrawText(A) defined in winuser.h only takes 5 arguments and it's completely missing font / color mentioned in all tutorials and forums. Am I doing something wrong?

DrawText(NULL, "text", -1, &rct, DT_NOCLIP|DT_SINGLELINE);

where &rct is my rectangle created before. I'm calling it directly in a child class of IDirect3DDevice9.

Thanks in advance

+1  A: 

You're using the wrong DrawText function (GDI). Try using the one from ID3DXFont. (after creating the font,etc..)

Kapil Kapre
Thanks, this is something that I didn't expected. I understand I can obtain font from the D3DXCreateFont, yet I don't have this method in the IDirect3DDevice9. MSDN does not say where it should be located http://bit.ly/9kv6Yg.
Mikulas Dite
D3DXCreateFont is a stand alone function, not a method.
Logan Capaldo
@Mikulas Like I said, the function is part of the ID3DXFont interface. http://bit.ly/d9cFN8. There could be a bug in the documentation you're using thats misleading you, maybe you can link us to a small piece of sample code that exhibits the problem..
Kapil Kapre
@Kapil Thank you, I've already managed to fix it. It indeed was GDI vs D3D problem.
Mikulas Dite