>> glVertex(0, height);
> This barfed at me - I presume this is meant to be glVertex2D, right?

2f, but yes.  I said it was pseudo-code, after all :)


> 
>> glEnd();
>> 
>> // done!  scaledTexture now has the scaled contents using bilinear scaling 
>> in hardware
>> // make sure to delete fbos and texture when done.
>> // ALSO: RESTORE ALL THE GL STATE!  NOT DOING SO WILL BLOW UP!
>> 
> Sorry for my ignorance, but what is the GL state and how do I restore it?


the GL state is the current state of the context (what you have bound, what 
various settings are, etc).  For example, in the above code I changed the 
matrix state (ModelView and Projection), forgot to change the viewport (oops, 
you'll want to add that too), the FBO binding, and the draw buffer.  Those must 
be restored for QC to continue operating normally after your patch executes.  
vade hinted at where to look to restore that stuff.

I _think_
> glPushAttrib(GL_ALL_ATTRIB_BITS);
> ... all the gl stuff ...
> glPopAttrib();

will properly restore everything, but it's a kinda heavyweight way to do that 
(it's probably marginally faster to restore just what you change, but that's a 
fair amount of additional code).

--
Christopher Wright
christopher_wri...@apple.com

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      (Quartzcomposer-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to