Sign in to follow this  

font text

This topic is 1905 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

[code]case WM_TIMER:
{
switch(wParam)
{
case ID_TIMER:
{
HRESULT hr=D3DXCreateFont(g_pd3dDevice, //D3D Device
22, //Font height
10, //Font width
FW_NORMAL, //Font Weight
1, //MipLevels
false, //Italic
DEFAULT_CHARSET, //CharSet
OUT_DEFAULT_PRECIS, //OutputPrecision
ANTIALIASED_QUALITY, //Quality
DEFAULT_PITCH|FF_DONTCARE,//PitchAndFamily
"Arial", //pFacename,
&g_font); //ppFont

D3DCOLOR fontColor = D3DCOLOR_XRGB(0,0,0);
RECT rct;
rct.left=200;
rct.right=600;
rct.top=20;
rct.bottom =50;
g_font-> DrawText(NULL,"Welcome to DX9 Pong",-1,&rct,DT_CENTER,fontColor);

KillTimer(hWnd,ID_TIMER);
}
break;
}
return 0;
}[/code] I am using the windows timer function to draw black text to the screen to cover up red text which I already drew to the screen.

Share this post


Link to post
Share on other sites
I don't know why this is so hard for you to understand: if you make a post and you have a question, then you need to actually ask the question. If you have an error you can't figure out, post the error.

Share this post


Link to post
Share on other sites
I don't know why you keep tying the DX rope around your neck. Since you are an obvious beginner, you shouldn't be trying to use Direct 3D. And, I don't know why you would keep trying to use the Windows message API when it too isn't the easiest thing to understand. But, for some unknown reason you just HAVE to use D3D.

Explain fully why you're using D3D/MS Windows API instead of something much simpler like SFML.

Share this post


Link to post
Share on other sites
I am using dx9 because I really want to learn how the professionals do it.I am getting better but it is slow going.I am not going to give up.

Share this post


Link to post
Share on other sites
[quote name='phil67rpg' timestamp='1351624831' post='4995529']
I am using dx9 because I really want to learn how the professionals do it.I am getting better but it is slow going.I am not going to give up.
[/quote]

Good that you won't give up, but you're just making things more painful for you than is required. Learn the easier methods, have fun with it, and WHEN YOU'RE READY, you can tackle the more difficult API's like D3D and OpenGL.

Or keep pounding sand like you're doing now.

Share this post


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