I’m having troubles understanding the way gl::draw functions (such as gl::drawSolidRect( Rectf ), or gl::draw( texture, Rectf ) ) handle the Rectf that is passed as argument.
In this piece of code (no 3d involved) :
const ci::gl::ScopedFramebuffer scopedFbo( mDrawingFbo ); const ci::gl::ScopedViewport scopedViewport( glm::ivec2( 0 ), mDrawingFbo->getSize() ); ci::gl::clear( ci::ColorA( 0.f, 0.f, 0.f, 1.f ) ); ci::gl::disableDepthRead(); ci::gl::disableDepthWrite(); auto prog = // Some gl::GlslProg here prog->bind(); prog->uniform( "uSize", mDrawingFbo->getSize() ); ci::gl::drawSolidRect( getWindowBounds() );
I have a Fbo that has a different size than the window size (so that I can control the quality of my rendering myself), in which I just want to render a fragment shader on the whole surface.
Now in a basic OpenGL app, I would simply draw a quad the size of my Fbo after binding my program, but from what I’m experimenting in Cinder, getWindowBounds() is always the Rectf that corresponds to my whole surface, no matter what size the latter is.
The Fbo bounds on the other hand, will either be too large or too small.
Am I missing something here ? or is Cinder somehow adapting the given Rectf to the current viewport ? (which I would find quite confusing in terms of usage)
I’m sorry if I missed other discussions about that.