Beispiel #1
0
void DefaultLayer::visit()
{
	// You don't want to globally set scissor test to true and then set it in your draw method or else
	// other unintended results may occur, like the FPS display not working, etc.
	glEnable(GL_SCISSOR_TEST);

	CCEGLView* view = CCEGLView::sharedOpenGLView();
	view->setScissorInPoints(getPosition().x, getPosition().y, getContentSize().width, getContentSize().height);

	CCLayerColor::visit();

	glDisable(GL_SCISSOR_TEST);
}