Skip to content

Instantly share code, notes, and snippets.

@sansumbrella
Created May 7, 2010 04:32
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sansumbrella/393058 to your computer and use it in GitHub Desktop.
Save sansumbrella/393058 to your computer and use it in GitHub Desktop.
Cinder Tile Render example
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 );
}
@sansumbrella
Copy link
Author

Tile rendering using Cinder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment