Program crash when calling Flip() in DX7
My program crashes everytime I call flip or attempt to blt on the back surface. Here is my Init code, tell me what is wrong:
DDSURFACEDESC2 ddsd;
DDSCAPS2 ddscaps;
DirectDrawCreateEx(NULL, (VOID**)&g_pDD, IID_IDirectDraw7, NULL);
g_pDD->SetCooperativeLevel(hWnd, flags);
g_pDD->SetDisplayMode(width, height, bpp, refresh, NULL);
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;
g_pDD->CreateSurface(&ddsd, &g_pDDSPrimary, NULL);
ZeroMemory(&ddscaps, sizeof(ddscaps));
ddscaps.dwCaps = DDSCAPS_BACKBUFFER;
g_pDDSPrimary->GetAttachedSurface(&ddscaps, &g_pDDSBack);
I can set the display mode and blt to the front surface, but I seem to be messing up when I initialize the back surface somehow. Thanks.
You''re dividing all the bit flags, you want to OR them.
Try switching the /''s to /''s.
Try switching the /''s to /''s.
Hi
well you dont check for the return values of the function. check eqach DDraw function return value.. if all return DD_OK then it is very odd that it crashes.. if not, you must check which function is not returning DD_OK and then check the return value and see what the error is !!
hope it helps
bruno sousa aka akura
well you dont check for the return values of the function. check eqach DDraw function return value.. if all return DD_OK then it is very odd that it crashes.. if not, you must check which function is not returning DD_OK and then check the return value and see what the error is !!
hope it helps
bruno sousa aka akura
It's good to be an outcast, you don't need to explain what you do, you just do it and say you don't belong there.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement