here is the code I am using.
void display_text_x(int x,int y)
{
d3ddev->BeginScene();
RECT font_rect;
if(x>=300 && x <=350 && y>=225 && y <=275)
{
font_rect.left=310;
font_rect.top=235;
font_rect.right=330;
font_rect.bottom=255;
board_x[0][0]=true;
}
if(x>=350 && x <=400 && y>=225 && y <=275)
{
font_rect.left=360;
font_rect.top=235;
font_rect.right=380;
font_rect.bottom=255;
board_x[0][1]=true;
}
if(x>=400 && x <=450 && y>=225 && y <=275)
{
font_rect.left=415;
font_rect.top=235;
font_rect.right=435;
font_rect.bottom=255;
board_x[0][2]=true;
}
if(x>=300 && x <=350 && y>=275 && y <=325)
{
font_rect.left=310;
font_rect.top=290;
font_rect.right=330;
font_rect.bottom=310;
board_x[1][0]=true;
}
if(x>=350 && x <=400 && y>=275 && y <=325)
{
font_rect.left=360;
font_rect.top=290;
font_rect.right=380;
font_rect.bottom=310;
board_x[1][1]=true;
}
if(x>=400 && x <=450 && y>=275 && y <=325)
{
font_rect.left=415;
font_rect.top=290;
font_rect.right=435;
font_rect.bottom=310;
board_x[1][2]=true;
}
if(x>=300 && x <=350 && y>=325 && y <=375)
{
font_rect.left=310;
font_rect.top=350;
font_rect.right=330;
font_rect.bottom=370;
board_x[2][0]=true;
}
if(x>=350 && x <=400 && y>=325 && y <=375)
{
font_rect.left=360;
font_rect.top=350;
font_rect.right=380;
font_rect.bottom=370;
board_x[2][1]=true;
}
if(x>=400 && x <=450 && y>=325 && y <=375)
{
font_rect.left=415;
font_rect.top=350;
font_rect.right=435;
font_rect.bottom=370;
board_x[2][2]=true;
}
HRESULT hr=D3DXCreateFontA(d3ddev,
20,
10,
FW_NORMAL,
1,
false,
DEFAULT_CHARSET,
OUT_DEFAULT_PRECIS,
ANTIALIASED_QUALITY,
DEFAULT_PITCH|FF_DONTCARE,
"Arial",
&g_font);
g_font->DrawTextA(NULL,"X",-1,&font_rect,DT_CENTER,0xFFFFFFFF);
d3ddev->EndScene();
d3ddev->Present(NULL, NULL, NULL, NULL);
}