Re: Cocoa-dev Digest, Vol 2, Issue 192
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 09:38:53 -0800
On Feb 9, 2005, at 6:06 PM, John Stiles wrote:
Jeez, a pixel shader just to fade to black?
Having OpenGL draw a big black semi-opaque square on top of the image
is just too easy, or what? :)
Seriously, if you need to have an OpenGL-based image fade to black,
drawing a big black square on top of it is a perfectly fine way to go.
Turn off depth test/write.
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
...
}
--
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