Jump to content
  • Advertisement

Archived

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

Gamekeeper

Blitting

This topic is 6030 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!