I am trying to display some text using dx 9 and c++.here is the code I am using.
void DisplaySomeText()
{
D3DCOLOR fontColor = D3DCOLOR_XRGB(255,0,0);
RECT rct;
rct.left=200;
rct.right=600;
rct.top=20;
rct.bottom =40;
g_Font-> DrawText(NULL,"Hello World",-1,&rct,0,fontColor);
}
yes in the following code, I am trying to pass in a string to be displayed on the screen.
void DisplaySomeText(string text)
{
D3DCOLOR fontColor = D3DCOLOR_XRGB(255,0,0);
RECT rct;
rct.left=200;
rct.right=600;
rct.top=20;
rct.bottom =40;
g_Font-> DrawText(NULL,text,-1,&rct,0,fontColor);
}
the text field in the drawtext line is giving me an error.
It's funny, but error messages often tell you what the problem is. While I can probably guess what your problem is from the code, you should probably examine the error message carefully and try to understand what it means. Try to break it down into pieces and see what parts you can understand and what parts you don't understand. And then ask a specific question about the parts you don't understand.
I am getting a runtime error with this line of code.
g_font-> DrawText(NULL,"HelloWorld",-1,&rct,0,fontColor);
everything else appears ok
let me know if you need more code.
I am getting a runtime error with this line of code.
g_font-> DrawText(NULL,"HelloWorld",-1,&rct,0,fontColor);
everything else appears ok
let me know if you need more code.