This topic is now archived and is closed to further replies.

Problems with a text engine

This topic is 5310 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Ok guys I''m having some difficulty implimenting the text engine that I found on this site, I followed all the directions after I set up DX 7 and ran the code. When I compile it, it makes my window and then doesn''t write the text. I ran the debugger and figured out that its skipping my create surface statement so it has the code for the text but nothing to put it on.... can you guys help me figure out why its skipping the line? //the actual game loop int GameLoop() { //initilize DirectX 7 if(FAILED (DirectDrawCreateEx( NULL, (LPVOID*) &lpDD,IID_IDirectDraw7, NULL) ) ) return FALSE; if(FAILED (lpDD->SetCooperativeLevel(hwnd, DDSCL_NORMAL))) { return FALSE; } if(FAILED (lpDD->SetDisplayMode(1024,768,16,0,0))) return FALSE; ZeroMemory(&ddsd,sizeof(ddsd)); ddsd.dwSize = sizeof(ddsd); ddsd.dwFlags = DDSD_CAPS | DDSD_BACKBUFFERCOUNT; ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_FLIP | DDSCAPS_COMPLEX; ddsd.dwBackBufferCount = 1; //this gets skipped if(FAILED (lpDD->CreateSurface(&ddsd,&lpDDSPrimary,NULL) ) ) return FALSE; //not sure if this one does cause the debugger never makes it here if(FAILED (lpDDSPrimary->GetAttachedSurface(&ddscaps,&lpDDSBack) ) ) return FALSE; ////////////////////////////////////////////////////////////////////////// HFONT fnt; fnt = CreateFont(14,0,0,0,0,0,0,0,0,0,0,0,0,"Arial"); Draw_Text("This text is in Arial at Size 14",0,0,RGB(255,255,255),lpDDSPrimary,fnt); I don''t know if you need more of the code so I''ll keep it small for now. Let me know if you want the rest.

Share this post

Link to post
Share on other sites