Merge branch 'v3FrameBufferObject' into v3Viewport

This commit is contained in:
Huabing.Xu 2015-05-29 14:10:49 +08:00
commit 2f32fcabba
3 changed files with 16 additions and 3 deletions

View File

@ -475,6 +475,11 @@ void Camera::applyFrameBufferObject()
}
}
void Camera::apply()
{
applyFrameBufferObject();
}
int Camera::getRenderOrder() const
{
int result(0);

View File

@ -213,9 +213,17 @@ public:
* Get the default camera of the current running scene.
*/
static Camera* getDefaultCamera();
/**
Before rendering scene with this camera, the background need to be cleared.
*/
void clearBackground(float depth);
/**
Apply the FBO, RenderTargets and viewport.
*/
void apply();
/**
Set FBO, which will attacha several render target for the rendered result.
*/
void setFrameBufferObject(FrameBufferObject* fbo);
void setViewport(const Viewport& vp) { _viewport = vp; }
CC_CONSTRUCTOR_ACCESS:

View File

@ -164,7 +164,7 @@ void Scene::render(Renderer* renderer)
director->pushMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION);
director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION, Camera::_visitingCamera->getViewProjectionMatrix());
camera->applyFrameBufferObject();
camera->apply();
//clear background with max depth
camera->clearBackground(1.0);
//visit the scene