Text in DirectDraw-Surface (C++)
-
Hallo!
Kann mir jemand sagen, wie man mit C++ einen String in eine DirectDraw-Surface zeichnen kann?
Unter VB gibt es in einer Surface-Instanz immer eine drawText-Methode, aber in C++ habe ich nichts vergleichbares gefunden.Danke im Voraus!
mfg
-
void Print(int x, int y, const char* text) { HDC hdc=NULL; if(m_lpDDSBack->GetDC(&hdc)==DD_OK) { SelectObject(hdc,CreateFont(20,0,0,0,0,0,0,0,0,0,0,0,FIXED_PITCH,0)); SetBkMode(hdc,TRANSPARENT); SetTextColor(hdc,m_dwColor); TextOut(hdc,x,y,text,lstrlen(text)); m_lpDDSBack->ReleaseDC(hdc); } }