How to Draw text into the device?

ID3DXFont::DrawText returns text height, but I can't see any text on the screen.
I call DrawText in the BeginScene ... EndScene block but nothing.
Why should it be?
Posted on 2003-11-03 18:37:19 by Vaxon
Good afternoon friends.
Here's the (100% working) helper proc I wrote for that purpose.
It allows you to mix font sizes freely and autocalculates the next Vertical position.

;Draws a line of text at given vertical position pVert and updates pVert for next time :)
;pVert is a pointer to your dword variable containing Vertical position

DrawTextLine PROC pFont:DWORD,pVert:DWORD,pText:DWORD, dwColor:DWORD
local rec:RECT
assume edi:nothing
push edi
mov edi,pVert
mov rec.left,0
m2m rec.right,sWid
m2m rec.top,dword ptr
m2m rec.bottom,sHgt
mov ebx,pFont
mcall ebx,ID3DXFont_DrawTextA, pText, -1, \ ;this returns height of text
addr rec, DT_CENTER OR DT_WORDBREAK , dwColor ;or zero for error
add ,eax ;add height of text (or zero)
pop edi
ret
DrawTextLine ENDP

Have a nice day :)
Posted on 2003-11-04 22:55:21 by Homer