Jump to content
  • Advertisement
Sign in to follow this  
dpseac02

pixel format for overlay using alpha

This topic is 4863 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

Hi to everyone, I need to build a foreground overlay with directdraw using a pixel format managing alpha channel in order to have different alpha value around the screen (I need to do a blending). I am newbie with directdraw and I'm using some example code managing overlay but I cannot understand what is the right pixel format I need and how can I force its use. For example I tried (whithout success) those statements: DDPIXELFORMAT formats = {sizeof(DDPIXELFORMAT), DDPF_ALPHA, 0, 8, 0xF800, 0x07e0, 0x001F, 0}; DDSURFACEDESC2 ddsdOverlay; memset(&ddsdOverlay, 0, sizeof(ddsdOverlay)); ddsdOverlay.dwSize = sizeof(ddsdOverlay); ddsdOverlay.ddsCaps.dwCaps = DDSCAPS_OVERLAY | DDSCAPS_FLIP | DSCAPS_COMPLEX | DDSCAPS_VIDEOMEMORY; ddsdOverlay.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_BACKBUFFERCOUNT | DDSD_PIXELFORMAT; ddsdOverlay.dwWidth = IMG_W; ddsdOverlay.dwHeight = IMG_H; ddsdOverlay.dwBackBufferCount = 1; HRESULT hr; ddsdOverlay.ddpfPixelFormat = formats[n]; hr = ddraw->CreateSurface(&ddsdOverlay, &overlay, 0); Can you help me? Thank you in advance. dp

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!