- Stage stage = Stage::GetCurrent();
- Vector2 stageSize = stage.GetSize();
-
- float contentHeight( (stageSize.y - BUTTON_HEIGHT)/2.0f );
- Vector2 imageSize( stageSize.x, contentHeight );
-
- mNativeImageSourcePtr = NativeImageSource::New( imageSize.width, imageSize.height, NativeImageSource::COLOR_DEPTH_DEFAULT );
- mNativeTexture = Texture::New( *mNativeImageSourcePtr );
-
- mFrameBuffer = FrameBuffer::New( mNativeTexture.GetWidth(), mNativeTexture.GetHeight(), FrameBuffer::Attachment::NONE );
- mFrameBuffer.AttachColorTexture( mNativeTexture );
-
- mCameraActor = CameraActor::New( imageSize );
- mCameraActor.SetParentOrigin( ParentOrigin::CENTER );
- mCameraActor.SetParentOrigin( AnchorPoint::CENTER );
- mTopContentArea.Add( mCameraActor );
-
- RenderTaskList taskList = stage.GetRenderTaskList();
- mOffscreenRenderTask = taskList.CreateTask();
- mOffscreenRenderTask.SetSourceActor( mSourceActor );
- mOffscreenRenderTask.SetClearColor( Color::WHITE );
- mOffscreenRenderTask.SetClearEnabled( true );
- mOffscreenRenderTask.SetCameraActor( mCameraActor );
- mOffscreenRenderTask.GetCameraActor().SetInvertYAxis( true );
- mOffscreenRenderTask.SetFrameBuffer( mFrameBuffer );
+ Window window = mApplication.GetWindow();
+ Vector2 windowSize = window.GetSize();
+
+ float contentHeight((windowSize.y - BUTTON_HEIGHT) / 2.0f);
+ Vector2 imageSize(windowSize.x, contentHeight);
+
+ mNativeImageSourcePtr = NativeImageSource::New(imageSize.width, imageSize.height, NativeImageSource::COLOR_DEPTH_DEFAULT);
+ mNativeTexture = Texture::New(*mNativeImageSourcePtr);
+
+ mFrameBuffer = FrameBuffer::New(mNativeTexture.GetWidth(), mNativeTexture.GetHeight(), FrameBuffer::Attachment::NONE);
+ mFrameBuffer.AttachColorTexture(mNativeTexture);
+
+ mCameraActor = CameraActor::New(imageSize);
+ mCameraActor.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+ mCameraActor.SetProperty(Actor::Property::PARENT_ORIGIN, AnchorPoint::CENTER);
+ mTopContentArea.Add(mCameraActor);
+
+ RenderTaskList taskList = window.GetRenderTaskList();
+ mOffscreenRenderTask = taskList.CreateTask();
+ mOffscreenRenderTask.SetSourceActor(mSourceActor);
+ mOffscreenRenderTask.SetClearColor(Color::WHITE);
+ mOffscreenRenderTask.SetClearEnabled(true);
+ mOffscreenRenderTask.SetCameraActor(mCameraActor);
+ mOffscreenRenderTask.GetCameraActor().SetInvertYAxis(true);
+ mOffscreenRenderTask.SetFrameBuffer(mFrameBuffer);