void cRender::DrawString(int x, int y, DWORD color, DWORD dwFlag, string fmt, ...)
{
char buffer[512];
va_list args;
va_start(args, fmt);
vsprintf_s(buffer, fmt.c_str(), args);
va_end(args);
DWORD dwMainFlags = NULL;
RECT r,
rs[4];
dwMainFlags = dwFlag | DT_CALCRECT | DT_NOCLIP;
g_pDevice->SetRenderState(D3DRS_ZENABLE, FALSE);
if (dwFlag & DT_SHADOW)
{
pSetRect(&rs[0], x - 1, y, x, 0);
pSetRect(&rs[1], x + 1, y, x, 0);
pSetRect(&rs[2], x, y - 1, x, 0);
pSetRect(&rs[3], x, y + 1, x, 0);
for (INT i = NULL; i < 4; i++)
{
this->pFont->DrawText(nullptr, buffer, -1, &rs[i], dwMainFlags, 0xFF000000);
if (dwMainFlags & DT_CALCRECT)
this->pFont->DrawText(nullptr, buffer, -1, &rs[i], NULL, 0xFF000000);
}
}
pSetRect(&r, x, y, x, 0);
this->pFont->DrawText(nullptr, buffer, -1, &r, dwMainFlags, color);
if (dwMainFlags & DT_CALCRECT)
this->pFont->DrawText(nullptr, buffer, -1, &r, NULL, color);
}