Jump to content
Site Stability Read more... ×
  • Advertisement
Sign in to follow this  

pixel format for overlay using alpha

This topic is 5205 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
Sign in to follow this  

  • Advertisement

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!