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

Started by
-1 comments, last by roby65 11 years, 11 months ago
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

This topic is closed to new replies.

Advertisement