From 7e7c3aeb1cab5f36424d74aeed3138941e5564ad Mon Sep 17 00:00:00 2001 From: visiblelight Date: Thu, 17 Jul 2014 19:53:35 +0800 Subject: [PATCH] The orientation of render texture should be rotated when _keepMatrix is true --- cocos/2d/CCRenderTexture.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cocos/2d/CCRenderTexture.cpp b/cocos/2d/CCRenderTexture.cpp index 4c30dc378e..b5f16595b6 100644 --- a/cocos/2d/CCRenderTexture.cpp +++ b/cocos/2d/CCRenderTexture.cpp @@ -570,6 +570,14 @@ void RenderTexture::onBegin() Mat4::createOrthographicOffCenter((float)-1.0 / widthRatio, (float)1.0 / widthRatio, (float)-1.0 / heightRatio, (float)1.0 / heightRatio, -1, 1, &orthoMatrix); director->multiplyMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION, orthoMatrix); } + else + { +#if CC_TARGET_PLATFORM == CC_PLATFORM_WP8 + Mat4 modifiedProjection = director->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION); + modifiedProjection = CCEGLView::sharedOpenGLView()->getReverseOrientationMatrix() * modifiedProjection; + director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION, modifiedProjection); +#endif + } //calculate viewport {