Drawing Things in DirectX ?
Ok, so finally i can draw on the CrossFire's Window, the hardest part of my menu is completed...
But currently, i only can draw a simple square...
I looked into Cf Manu sources, to learn how to draw strings, but when i try to draw any string, Cf windows isnt appaer, and after a period of time, it the crossfire process exit...
The code:
But currently, i only can draw a simple square...
I looked into Cf Manu sources, to learn how to draw strings, but when i try to draw any string, Cf windows isnt appaer, and after a period of time, it the crossfire process exit...
The code:
Code:
LPD3DXFONT Font;
void WriteText( LPDIRECT3DDEVICE9 pDevice, char* str, int size, int x, int y, DWORD color)
{
static RECT textbox;
SetRect(&textbox, x, y, 900, 900);
D3DXCreateFont(pDevice, size, 0, FW_NORMAL, 1, false, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, L"Arial", &Font);
if (Font) Font->DrawTextA(NULL, str, strlen(str), &textbox, DT_LEFT | DT_TOP, color);
}

