[FIXED] D3DXCreateFontA Problem [D3D9 EndScene() Hook]

Everything related to 3D programming
CodeCave
User
User
Posts: 16
Joined: Wed Jun 19, 2013 10:50 pm

[FIXED] D3DXCreateFontA Problem [D3D9 EndScene() Hook]

Post by CodeCave »

Hi, i want to create an overlay for a program therefore i hook the D3D9 device of that program...
The problem is i just cant get the Text drawing to work :S
If anyone could help me or point me in the right direction i would be really happy :D
- PureBasic 4.51
- Windows x86

Code: Select all

Global *amefont.ID3DXFont
Global *amesprite.ID3DXSprite

Procedure D3D_Text(x, y, text.s, color.l) ;<- WORKS USE RGBA!!!!
  textrect.RECT
  textrect\left= x 
  textrect\top= y
  *amesprite\Begin(#D3DXSPRITE_ALPHABLEND | #D3DXSPRITE_SORT_TEXTURE)
  *amefont\DrawTextA(*amesprite, text, -1, @textrect, #DT_CALCRECT|#DT_LEFT,0)
  *amefont\DrawTextA(*amesprite, text, -1, @textrect, #DT_LEFT, color)
  *amesprite\End()
EndProcedure
(sorry about my bad english...)
Last edited by CodeCave on Thu Jun 20, 2013 8:11 pm, edited 2 times in total.
CodeCave
User
User
Posts: 16
Joined: Wed Jun 19, 2013 10:50 pm

Re: [FIXED] D3DXCreateFontA Problem [D3D9 EndScene() Hook]

Post by CodeCave »

Since im new to PB and d3d stuff in general it took me a while to find out what i was doing wrong...
I just forgot that the color of the text needs to be RGBA ^.^
Post Reply