Skip to main content
GameDev.net gamedev.net
🔒 Locked

Blitting

Started by Gamekeeper Dec 18, 2001 at 7:35 AM 0 replies 300+ views
Original Post
Gamekeeper
Gamekeeper
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!
Message from above:Damn, my hair is grey!
monkey-poop
monkey-poop
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!!!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.