openframeworks/openFrameworks — pull request #1264 by ofTheo (2012-05-17 15:09:51+00:00)
Title: cleanup for ofFbo.cpp - tries to reduce redundent code and also better s...

...upport for POT textures. Lots of fixes for iOS also. Please take a look.
This is related to issue #1263

would be good to have eyes on from @damiannz @elliotwoods @memotv @kylemcdonald @obviousjim @julapy @arturoc and anyone who knows about fbos :)

some of the big changes are:
1) make the depth as texture and stencil as texture match the texture type of the main fbo texture ( ie ARB if main is ARB and TEX_2D if main is TEX_2D ).
2) if depth textures are TEX_2D then calculating the proper t and u coords based on the requested sizes and the adjusted pot sizes.
3) check for ofGetUsingArb when FBO initializes - instead of being hard coded to ARB
4) less ifdefs for OPENGL_ES
5) auto addition of stencil buffer for ios fbo that has depth requested ( need both to get a depth buffer )
6) auto pot for iOS now works with depth buffer
7) general redundent code cleanup.

mainly tested this on iOS - need to test more on desktop - but would be great to have fbo heads look at this.
For example depth and stencil textures had TEXTURE_2D hardcoded - maybe there was a reason for this?