Archived

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

Fade to black in DirectDraw????

This topic is 5112 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, I''d like to fade the screen to black and white when my game is over. I would like to average the R,G,and B values in each pixel of my surface. I am using VC++6, DIrectDraw 7.0 with no palette, and 16 bit images. Here''s some of my code that may or may not be relevant: if (DirectDrawCreateEx(NULL, (void **)&lpdd, IID_IDirectDraw7, NULL)!=DD_OK) Error("DirectDrawCreate Fail"); // set cooperation level to windowed mode normal if (lpdd->SetCooperativeLevel(main_window_handle, DDSCL_ALLOWMODEX | DDSCL_FULLSCREEN | DDSCL_EXCLUSIVE | DDSCL_ALLOWREBOOT)!=DD_OK) Error("CooperativeLabel Fail"); // set the display mode if (lpdd->SetDisplayMode(SCREEN_WIDTH,SCREEN_HEIGHT,SCREEN_BPP,0,0)!=DD_OK) Error("SetDisplayMode Fail"); // Create the primary surface memset(&ddsd,0,sizeof(ddsd)); ddsd.dwSize = sizeof(ddsd); ddsd.dwFlags = DDSD_CAPS | DDSD_BACKBUFFERCOUNT; // we need to let dd know that we want a complex // flippable surface structure, set flags for that ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_FLIP | DDSCAPS_COMPLEX; // set the backbuffer count to 1 ddsd.dwBackBufferCount = 1; // create the primary surface lpdd->CreateSurface(&ddsd,&lpddsprimary,NULL); // query for the backbuffer i.e the secondary surface ddscaps.dwCaps = DDSCAPS_BACKBUFFER; (*lpddsprimary).GetAttachedSurface(&ddscaps,&lpddsback); by the way, if someone could clue me in on how to post a window to enclose code snippets, Id appreciate it. Thanks for any help you can give me.

Share this post


Link to post
Share on other sites