• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Cocoa-dev Digest, Vol 2, Issue 192
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cocoa-dev Digest, Vol 2, Issue 192


  • Subject: Re: Cocoa-dev Digest, Vol 2, Issue 192
  • From: Shaun Wexler <email@hidden>
  • Date: Thu, 10 Feb 2005 10:37:13 -0800

On Feb 10, 2005, at 9:38 AM, Shaun Wexler wrote:

int i, n = numFramesInLinearFade;
glDrawBuffer(GL_FRONT);
glEnable(GL_BLEND);
glColor4f(0.0f, 0.0f, 0.0f, 1.0f/(float)n);
for (i = 0; i < n; i++) {
	glRectf(minX, minY, maxX, maxY);
	glFlush();
	// wait for next VBL
	...
}

Oops, above code is wrong. You want an exponential fade to near-zero, so it's smooooth:


int i, n = numFramesInLinearFade;
float oneOver2n = 0.5f/(float)n;
glDrawBuffer(GL_FRONT);
glEnable(GL_BLEND);
for (i = 1; i <= n; i++) {
	glColor4f(0.0f, 0.0f, 0.0f, (float)i * oneOver2n);
	glRectf(minX, minY, maxX, maxY);
	glFlush();
	// wait for next VBL
	...
} // faded to < 1.53e-03
glColor4f(0.0f, 0.0f, 0.0f, 1.0f);
glRectf(minX, minY, maxX, maxY);
glFlush();
--
Shaun Wexler
MacFOH
http://www.macfoh.com

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: Cocoa-dev Digest, Vol 2, Issue 192 (From: Dominic Feira <email@hidden>)
 >Re: Cocoa-dev Digest, Vol 2, Issue 192 (From: John Stiles <email@hidden>)
 >Re: Cocoa-dev Digest, Vol 2, Issue 192 (From: Shaun Wexler <email@hidden>)

  • Prev by Date: Re: CFSocketSetRemoteAddress, UDP sockets, and error handling
  • Next by Date: Re: Objective C class prefix
  • Previous by thread: Re: Cocoa-dev Digest, Vol 2, Issue 192
  • Next by thread: Newbie design question: protocol vs. delegate vs. class-cluster
  • Index(es):
    • Date
    • Thread