Why does this lock up?
------------------
Still Learning...
But now to the point:
I havn't been able to connect to this site for a couple of days (until now) either. What was wrong?
Uploading icons?(!)
I'll try to keep it to a minimum; I was having problems getting the bitmap to load, and found that the DDLoadPalette was returning (0). I commented that part out of the code but now I can't get out of the program once the bitmap loads. Escape & F12 do nothing. Any help?
=============================================
int GameInit( HINSTANCE hInstance, int nCmdShow)
// I created the window here & then...
// created DD object & stuff (800,600,8)
// Creating a primary surface with one back buffer
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;
if(FAILED(lpdd->CreateSurface(&ddsd, &lpddsprimary, NULL)))
{
return(0);
}
// Get the pointer to the back buffer
ZeroMemory(&ddscaps, sizeof(ddscaps));
ddscaps.dwCaps = DDSCAPS_BACKBUFFER;
if(FAILED(lpddsprimary->GetAttachedSurface(&ddscaps, &lpddsback)))
{
return(0);
}
// Create an offscreen surface for bitmap
ddsd.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH;
ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN;
ddsd.dwHeight = 600;
ddsd.dwWidth = 800;
if(FAILED(lpdd->CreateSurface(&ddsd, &lpddsoff1, NULL)))
{
return(0);
}
/* if(FAILED(lpddpal = DDLoadPalette(lpdd, szBitmap)))
{
return(0);
}*/
/* if(FAILED(lpddsprimary->SetPalette(lpddpal)))
{
return(0);
}*/
if(FAILED(InitSurfaces()))
{
return(0);
}
if(TIMER_ID != SetTimer(hwnd, TIMER_ID, TIMER_RATE, NULL))
{
return (0);
}
return(1);
}
//-----------------------------------------
int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow)
{
MSG msg;
GameInit(hInstance, nCmdShow);
while(GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
}
=============================================
I left out what I didn't think was important, but if you need to see WindowProc or whatever I can post it too.
------------------
Still Learning...
no, it wasn't the icons (which I uploaded early last week, I think). For reasons that I've not yet been able to determine, the server was down almost constantly from sometime late Saturday night until this morning. It seems fine now, so hopefully it will stay that way.
- Dave