Skip to main content
gamedev.net
🔒 Locked

ddraw blt() problem

Started by webbit Mar 21, 2005 at 9:38 PM 0 replies 450+ views
Original Post
webbit
webbit
Hi, I was following Andre' Lamothe's Tricks of the Windows Game Programming Gurus (yes I know it's old), trying to create a DirectDraw Component for Borland C++ Builder 6. It all went well untill I'm trying to use the blt() to clear the screen, i.e. do a memory fill with the blt() to fill the screen with black. the code is as follow: void __fastcall TDDrawControl::ddClrScr(void) { DDBLTFX ddbltfx; memset(&ddbltfx, 0, sizeof(ddbltfx)); ddbltfx.dwSize = sizeof(ddbltfx); ddbltfx.dwFillColor = 0; RECT rect = Rect(0, 0, ddWidth, ddHeight); lpddsprimary->Blt(▭, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &ddbltfx); } ddWidth and ddHeight is the screen resolution. when the function is called, the screen filled with black and the Windows Start Bar appears (though in very ugly 256 colors, since I'm doing 256 colors testing) and my application freezes. I could press Ctrl-F2 for C++ Builder to reset the test application at this point, but if I clicked on the application surface, the whole PC will freeze, I'd have to press Ctrl-Alt-Del to call up Task Manager and terminate both my test app and C++ Builder (I'm using Win XP Pro SP2 as my development platform). Anyone have any idea what's wrong with my app/component? Thanks in advance.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.