hello I coded a game engine with a complete gui system.... it has a debug gdi output mode a directx 6 mode a directx 8 mode and an open gl mode... the other modes work fine for now but I have an issue where the GDI mode crashes to a black screen randomly
when the app is operationg.. this happens more often on restoring from minimized or on resizing......
please email responses to
ThomasCannady@comcast.net as well as posting them here... also could you
put "URGENT" in the email title... thanks
here is the GDI code :
void
gdi_update(void
)
{
//#ifdef FEVTRACKFPS
// dofps();
#
//endif
// Copy the backbuffer to the window
// Single Threaded Version
HDC hdcDIBSection;
HBITMAP holdbitmap;
hdc = GetDC(mainwin);
hdcDIBSection = CreateCompatibleDC(hdc);
if
(gdibackbufferpage==0)
holdbitmap = (HBITMAP)SelectObject(hdcDIBSection, (HGDIOBJ)backbufferhandle1);
else
holdbitmap = (HBITMAP)SelectObject(hdcDIBSection, (HGDIOBJ)backbufferhandle2);
BitBlt(hdc, 0, 0, screenwidth, screenheight, hdcDIBSection,
0, 0, SRCCOPY);
ReleaseDC(mainwin, hdc);
SelectObject(hdcDIBSection, holdbitmap);
DeleteDC(hdcDIBSection);
checkmsg();
}