Created
May 7, 2010 04:32
-
-
Save sansumbrella/393058 to your computer and use it in GitHub Desktop.
Cinder Tile Render example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void yourApp::renderTiles() | |
{ | |
//the size here doesn't matter, but it will get distorted if it's not the same ratio as your window | |
gl::TileRender tr( getWindowWidth()*4, getWindowHeight()*4 ); | |
//use the default cinder view to render from | |
tr.setMatricesWindow(getWindowWidth(), getWindowHeight()); | |
while( tr.nextTile() ) { | |
draw(); | |
} | |
writeImage( getHomeDirectory() + "appFolder" + getPathSeparator() + "output.png", tr.getSurface() ); | |
//reset window matrix back to normal (if you aren't changing it with a camera) | |
gl::setMatricesWindow( getWindowWidth(), getWindowHeight(), true ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Tile rendering using Cinder.