use a different size to create fbo

This commit is contained in:
Huabing.Xu 2015-05-29 10:00:48 +08:00
parent 2d6d1b7a8c
commit df09bef567
1 changed files with 4 additions and 3 deletions

View File

@ -1432,7 +1432,8 @@ void CameraFrameBufferObjectTest::onEnter()
{ {
auto sizeInpixels = Director::getInstance()->getWinSizeInPixels(); auto sizeInpixels = Director::getInstance()->getWinSizeInPixels();
auto size = Director::getInstance()->getWinSize(); auto size = Director::getInstance()->getWinSize();
auto fbo = FrameBufferObject::create(1, sizeInpixels.width, sizeInpixels.height); auto fboSize = Size(sizeInpixels.width * 1, sizeInpixels.height * 1.5);
auto fbo = FrameBufferObject::create(1, fboSize.width, fboSize.height);
CameraBaseTest::onEnter(); CameraBaseTest::onEnter();
//auto sprite = Sprite::createWithTexture(fbo); //auto sprite = Sprite::createWithTexture(fbo);
@ -1448,8 +1449,8 @@ void CameraFrameBufferObjectTest::onEnter()
// sprite->runAction(RepeatForever::create(animate)); // sprite->runAction(RepeatForever::create(animate));
//} //}
//sprite->setPosition(Vec2(100,100)); //sprite->setPosition(Vec2(100,100));
auto rt = RenderTarget::create(sizeInpixels.width, sizeInpixels.height); auto rt = RenderTarget::create(fboSize.width, fboSize.height);
auto rtDS = RenderTargetDepthStencil::create(sizeInpixels.width, sizeInpixels.height); auto rtDS = RenderTargetDepthStencil::create(fboSize.width, fboSize.height);
fbo->AttachRenderTarget(rt); fbo->AttachRenderTarget(rt);
fbo->AttachDepthStencilTarget(rtDS); fbo->AttachDepthStencilTarget(rtDS);
auto sprite = Sprite::createWithTexture(fbo->getRenderTarget()->getTexture()); auto sprite = Sprite::createWithTexture(fbo->getRenderTarget()->getTexture());