I am trying to draw a text to a direct draw surface but I can't get it for some reason...........I know I am wrong but I mean the book doens't tell me how to do that......
Code:
//create our first Direct Draw Object
HRESULT ErrorCheck=DirectDrawCreateEx(NULL, (void**)&DirectDrawObject, IID_IDirectDraw7, NULL);
DirectDrawObject->SetDisplayMode(800,600,16,0,0);
DirectDrawObject->SetCooperativeLevel(hWndMain, DDSCL_EXCLUSIVE|DDSCL_FULLSCREEN|DDSCL_ALLOWREBOOT);
DDSURFACEDESC2 GameTittle;
memset(&GameTittle,0, sizeof (DDSURFACEDESC2));
GameTittle.dwFlags=DDSD_CAPS;
GameTittle.ddsCaps.dwCaps=DDSCAPS_PRIMARYSURFACE;
DirectDrawObject->CreateSurface(&GameTittle, &GameTittleSurface, NULL);
////////////////////////////////////////////////////
/////////////////////////////////////////////////////
///fonts
//////////////////////////////////////////////////////
//////////////////////////////////////////////////////
HFONT NewFont;
HFONT OldFont;
HDC dc;
GameTittleSurface->GetDC(&dc);
AddFontResource( "Dark Crystal Outline.ttf");
NewFont=CreateFont(-40, 0,0,0,0,0,0,0,0,0,0,0,0,"Dark Crystal Outline");
OldFont=(HFONT)SelectObject(dc, NewFont);
SetBkMode(dc, TRANSPARENT);
SetTextColor(dc, RGB (0,255,0));
RECT rect;
GetClientRect (hWndMain, &rect);
DrawText(dc, TEXT ("Welcome "),-1,&rect, DT_CENTER|DT_VCENTER|DT_SINGLELINE);