Archived

This topic is now archived and is closed to further replies.

Gamekeeper

Blitting

Recommended Posts

How do I blit the z-buffer to the back buffer with DX7? Do I have to set some special flags when creating my surfaces or what? I have had quite many blitting problems, if you have any suggestions, please tell me. Message from above: Damn, my hair is grey!

Share this post


Link to post
Share on other sites
Here''s how you would create and attach it:

---------------------

LPDIRECTDRAW7 ZBuffer;
DDSURFACEDESC2 SurfaceDesc;

ZeroMemory (&SurfaceDesc, sizeof SurfaceDesc);

SurfaceDesc.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT;
SurfaceDesc.ddsCaps.dwCaps = DDSCAPS_ZBUFFER | DDSCAPS_VIDEOMEMORY;
SurfaceDesc.dwWidth = 800;
SurfaceDesc.dwHeight = 600;
SurfaceDesc.ddpfPixelFormat.dwSize = sizof (DDPIXELFORMAT);
SurfaceDesc.ddpfPixelFormat.dwFlags = DDPF_ZBUFFER;
SurfaceDesc.ddpfPixelFormat.dwZBufferBitDepth = 24;
SurfaceDesc.ddpfPixelFormat.dwZBitMask = 0xFFFFFF;

DirectDraw7->CreateSurface (&SurfaceDesc, &ZBuffer, NULL);

----------------------

I hope that helps!!!

Share this post


Link to post
Share on other sites