• Advertisement
Sign in to follow this  

[C++] Drawing 3d text in directx hook

This topic is 2155 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi guys,

i managed to hook directx in a game and now i wanted to draw a text in 3d space.
My code:

Init:

hdc=CreateCompatibleDC(NULL);
font=CreateFont(1000,0,0,0,FW_NORMAL,false,false,false,DEFAULT_CHARSET,OUT_DEFAULT_PRECIS,CLIP _DEFAULT_PRECIS,DEFAULT_QUALITY,DEFAULT_PITCH|FF_DONTCARE,"Arial");
SelectObject(hdc, font);
D3DXCreateText(this->m_pIDirect3DDevice9,hdc,"Hello World",0.001f,0.4f,&mesh,NULL,NULL);

Beforce EndScene:

m_pIDirect3DDevice9->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE);
D3DXMATRIX world_matrix; //Pre-initialized
D3DXMatrixIdentity(&world_matrix);
D3DXMatrixTranslation(&world_matrix,-67762,3567,8384);
m_pIDirect3DDevice9->SetTransform(D3DTS_WORLD,&world_matrix);
mesh->DrawSubset(0);


My problems:
The rendering appears like this:
http://img853.images...reenshot0rh.jpg
As you can see, the text is nor in 3d, nor transformed and also it seems like a "mask" of the scene.

What can be the problem? Why 3d is not working,, nad the 3d text has this effect?

Roby

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement