help me to find errors! Thanks
-
Hello everyone, An error occur when I debug the follow codes,please help me tofind the errors,Thanks! DDSURFACEDESC2 ddsd; LPDIRECTDRAWSURFACE4 g_pDDSBack = NULL; //DirectDraw back surface HRESULT hRet; memset(&ddsd, 0, sizeof(ddsd)); ddsd.dwSize = sizeof(ddsd); ddsd.dwFlags= DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_PIXELFORMAT | DDSD_BACKBUFFERCOUNT; ddsd.ddsCaps.dwCaps = DDSCAPS_OVERLAY | DDSCAPS_VIDEOPORT | DDSCAPS_SYSTEMMEMORY| //DDSCAPS_VIDEOMEMORY | DDSCAPS_FLIP | DDSCAPS_BACKBUFFER | DDSCAPS_COMPLEX| FALSE; ddsd.dwBackBufferCount = 1; ddsd.dwWidth =g_SurfWidth; ddsd.dwHeight =g_SurfHeight*g_Factor; ddsd.ddpfPixelFormat.dwFlags = DDPF_FOURCC; ddsd.ddpfPixelFormat.dwFourCC=mmioFOURCC ('Y','U','Y','V'); Line1: hRet = g_pDD->CreateSurface(&ddsd, &g_pDDSBack, NULL); Note : g_pDD is a created LPDIRECTDRAW4 vairable Add I have checked the value of g_pDD. It's not zero! g_SurfWidth,g_SurfHeight,g_Factor are all initialzed! but When I excute the program g_pDDSback is zero! why? Is there some errors at the setting of ddsd? free like a bird
-
Hello everyone, An error occur when I debug the follow codes,please help me tofind the errors,Thanks! DDSURFACEDESC2 ddsd; LPDIRECTDRAWSURFACE4 g_pDDSBack = NULL; //DirectDraw back surface HRESULT hRet; memset(&ddsd, 0, sizeof(ddsd)); ddsd.dwSize = sizeof(ddsd); ddsd.dwFlags= DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_PIXELFORMAT | DDSD_BACKBUFFERCOUNT; ddsd.ddsCaps.dwCaps = DDSCAPS_OVERLAY | DDSCAPS_VIDEOPORT | DDSCAPS_SYSTEMMEMORY| //DDSCAPS_VIDEOMEMORY | DDSCAPS_FLIP | DDSCAPS_BACKBUFFER | DDSCAPS_COMPLEX| FALSE; ddsd.dwBackBufferCount = 1; ddsd.dwWidth =g_SurfWidth; ddsd.dwHeight =g_SurfHeight*g_Factor; ddsd.ddpfPixelFormat.dwFlags = DDPF_FOURCC; ddsd.ddpfPixelFormat.dwFourCC=mmioFOURCC ('Y','U','Y','V'); Line1: hRet = g_pDD->CreateSurface(&ddsd, &g_pDDSBack, NULL); Note : g_pDD is a created LPDIRECTDRAW4 vairable Add I have checked the value of g_pDD. It's not zero! g_SurfWidth,g_SurfHeight,g_Factor are all initialzed! but When I excute the program g_pDDSback is zero! why? Is there some errors at the setting of ddsd? free like a bird
You've not told us what this code snippet is doing. What value does
hRet
have after callingCreateSurface()
?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
-
You've not told us what this code snippet is doing. What value does
hRet
have after callingCreateSurface()
?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
-
Sorry!I forget! After calling CreateSurface() hRet=DDERR_NOOVERLAYHW; Is that means display doesn't support overlay surface? Thanks! free like a bird!
Guoguor wrote: Is that means display doesn't support overlay surface? Correct, no overlay hardware is present or available.
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow