This is a snippet from my DX game:
Code:
//+-----------------------------------------------------------------------------
//| Renders some text on the screen
//+-----------------------------------------------------------------------------
VOID GRAPHICS::RenderText(INT X, INT Y, CONST CHAR* Text)
{
//Data
HDC Hdc;
//Attempt to get a DC
if(FAILED(SecondarySurface->GetDC(&Hdc)))
{
return;
}
//Set data
SetTextColor(Hdc, 0x00eeeeee);
SetBkColor(Hdc, 0x00000000);
SetBkMode(Hdc, TRANSPARENT);
//Print text
TextOut(Hdc, X, Y, Text, strlen(Text));
//Release the DC
SecondarySurface->ReleaseDC(Hdc);
}