cinder/Cinder — pull request #297 by zsero (2013-02-17 09:27:11+00:00)
Title: Added splitSubRect to Rect

Added splitSubRect to Rect. Splits the Rect to equal sized sub-rectangles.

Very useful for tiled window rendering, for example:

tileW = 3;
tileH = 2;

Rectf window = Rectf( getWindowBounds() );

gl::draw( mSurfRGBImage, window.splitSubRect( tileW, tileH, 0, 0 ) );
gl::draw( mChIRImage, window.splitSubRect( tileW, tileH, 1, 0 ) );
gl::draw( mChDepthImage, window.splitSubRect( tileW, tileH, 2, 0 ) );
gl::draw( mChBlobImage, window.splitSubRect( tileW, tileH, 0, 1 ) );