Archived

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

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

Recommended Posts

Okay I am currently making a game in MSVC++ in Direct Draw in 16 bpp. I am trying to make the screen fade to black but it will not work. Can anyone help me to have the screen fade to black? Edited by - wendieu on March 20, 2002 1:55:03 PM

Use the Gamma

Share on other sites
Could you be more specific, I do not know how to use gama.

Share on other sites
Thanks, but will it work in RGB modes (ie: 16,24,32 bpp?)

Share on other sites
Should do, though I''ve not tried it. From the article:
quote:
First your primary surface has to be at least 16 bit or greater.

Share on other sites
gamma is not supporte dont all cards, plus is a stupid method. instead look at the articles on how to do blending on this site. games that use gamma control for this tend to screw up the desktop if they crash, assuming that the card supports it. search the board, this question has been asked and answered before (with some code i might add).

Share on other sites
I have been searching for those kind of articles everywhere can someone help?

Share on other sites
hmm, i guess you dont know how to search well

http://www.gamedev.net/reference/programming/features/mmxblend/

that was found in mere seconds using gamedevs search engine.

Share on other sites
thanks I am not too familiar with this site that much. How can do a search...?(This is probably the second time I had posted a topic here)

Share on other sites
If you''re just fading to black.. why not do something like this.. obviously there are more efficient ways of doing this, but at least this will show you exactly what''s going on :o).

you have your pointer to a 16-bit surface, and you''re width/height (unsigned short *Ptr_16Bit,unsigned short width ,height.

  void Fade16(unsigned short *Ptr_16Bit, unsigned short width, unsigned short height){ int x,y; unsigned char r,g,b; for (y=0;y!=height;++y) {  for (x=0;x!=width;++x)  {//Get r,g,b   r = ((*Ptr_16Bit)&31);   g = (((*Ptr_16Bit)>>5)&63);   b = (((*Ptr_16Bit)>>11)&31);   if (r) --r; //Subrtact 1 if not 0!   if (g) --g; //Subrtact 1 if not 0!   if (b) --b; //Subrtact 1 if not 0!   *Ptr_16Bit=(b<<11) + (g<<5) + r; //Set our new value!   ++Ptr_16Bit; //Increment to next value!  } }}

Billy - BillyB@mrsnj.com

Share on other sites
Is there a way to do something like this in 8bpp?

Share on other sites
Generally fading to black in 8bpp is done by just changing the palette.

Share on other sites
I can mail you the code for eight bit if you want me to.
And how can I use gamedev''s search engine?

Share on other sites
Forum search:
Click "search" (above and to the right)

Article search:
Go to "Articles & Resources"

• Forum Statistics

• Total Topics
628691
• Total Posts
2984248

• 16
• 13
• 13
• 10
• 10