Strange DirectDraw problem

Started by
0 comments, last by The C modest god 20 years, 6 months ago
I use the following code IERRSTRING ("DirectDraw", IDirectDraw7_SetDisplayMode (pSDO->pDevice, pDDSD->dwWidth, pDDSD->dwHeight, pDDSD->ddpfPixelFormat.dwRGBBitCount, 0, 0)); INITIALDXSTRUCT (pSDO->Caps); IERRSTRING ("DirectDraw", IDirectDraw7_GetCaps (pSDO->pDevice, &(pSDO->Caps), NULL)); INITIALDXSTRUCT (ddsd); ddsd.dwFlags = DDSD_CAPS | DDSD_BACKBUFFERCOUNT; ddsd.dwBackBufferCount = 1; if (pSDO->Caps.dwVidMemFree>=(pDDSD->dwWidth*pDDSD->dwHeight*(pDDSD->ddpfPixelFormat.dwRGBBitCount>>3))) { ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_FLIP | DDSCAPS_COMPLEX | DDSCAPS_VIDEOMEMORY;/* | DDSCAPS_LOCALVIDMEM;*/ } else { ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_FLIP | DDSCAPS_COMPLEX; } IERRSTRING ("DirectDraw", IDirectDraw7_CreateSurface(pSDO->pDevice, &ddsd, &pSDDB->Primary, NULL)); INITIALDXSTRUCT (pSDDB->Desc); IERRSTRING ("DirectDraw", IDirectDrawSurface7_GetSurfaceDesc (pSDDB->Primary, &pSDDB->Desc)); memset (&caps, 0, sizeof (caps)); if (pSDO->Caps.dwVidMemFree>=(pDDSD->dwWidth*pDDSD->dwHeight*(pDDSD->ddpfPixelFormat.dwRGBBitCount>>3))) caps.dwCaps = DDSCAPS_FLIP | DDSCAPS_COMPLEX | DDSCAPS_BACKBUFFER | DDSCAPS_VIDEOMEMORY/* | DDSCAPS_LOCALVIDMEM*/; else caps.dwCaps = DDSCAPS_FLIP | DDSCAPS_COMPLEX | DDSCAPS_BACKBUFFER; IERRSTRING ("DirectDraw", IDirectDrawSurface7_GetAttachedSurface(pSDDB->Primary, &caps, &pSDDB->Buffer)); The code creates a direct draw primary surface with an attached buffer surface. The strange problem is that sometimes the buffered surface is created with a different resolution then the primary surface. The screen would flip from one resolution surface to a different resolution surface. Directdraw wont allow to creat primary surface with the width and height specified at the DDSURFDESC2. Do you have any idea what can cause this? I would appreaciate help on this matter.
It's all about the wheel.Never blindly trust technoligy.I love my internal organs.Real men don't shower.Quote:Original post by Toolmaker Quote:Original post by The C modest godHow is my improoved signature?It sucks, just like you.
Advertisement
Still the wrong forum... Also moved to DirectX.

This topic is closed to new replies.

Advertisement