Jump to content

View more

Image of the Day

Inventory ! Va falloir trouver une autre couleur pour le cadre D: #AzTroScreenshot #screenshotsaturday https://t.co/PvxhGL7cOH
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

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

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
No replies to this topic

#1 roby65   Members   

154
Like
0Likes
Like

Posted 30 May 2012 - 04:34 PM

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




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.