font text

Started by
4 comments, last by BeerNutts 11 years, 5 months ago
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;
}
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.
Advertisement
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.
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.

My Gamedev Journal: 2D Game Making, the Easy Way

---(Old Blog, still has good info): 2dGameMaking
-----
"No one ever posts on that message board; it's too crowded." - Yoga Berra (sorta)

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.
I am not exactly sure what your problem is.

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.


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.

My Gamedev Journal: 2D Game Making, the Easy Way

---(Old Blog, still has good info): 2dGameMaking
-----
"No one ever posts on that message board; it's too crowded." - Yoga Berra (sorta)

This topic is closed to new replies.

Advertisement