2 * Copyright (c) 2016 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use *this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include <dali/public-api/rendering/frame-buffer.h>
22 #include <dali/internal/event/rendering/frame-buffer-impl.h> // Dali::Internal::FrameBuffer
28 FrameBuffer FrameBuffer::New( unsigned int width, unsigned int height, unsigned int attachments )
30 Internal::FrameBufferPtr frameBuffer = Internal::FrameBuffer::New( width, height, attachments );
31 return FrameBuffer( frameBuffer.Get() );
34 FrameBuffer::FrameBuffer()
38 FrameBuffer::~FrameBuffer()
42 FrameBuffer::FrameBuffer( const FrameBuffer& handle )
43 : BaseHandle( handle )
47 FrameBuffer FrameBuffer::DownCast( BaseHandle handle )
49 return FrameBuffer( dynamic_cast<Dali::Internal::FrameBuffer*>(handle.GetObjectPtr()));
52 FrameBuffer& FrameBuffer::operator=( const FrameBuffer& handle )
54 BaseHandle::operator=( handle );
58 FrameBuffer::FrameBuffer( Internal::FrameBuffer* pointer )
59 : BaseHandle( pointer )
63 void FrameBuffer::AttachColorTexture( Texture& texture )
65 AttachColorTexture( texture, 0u, 0u );
68 void FrameBuffer::AttachColorTexture( Texture& texture, unsigned int mipmapLevel, unsigned int layer )
72 Internal::NewTexturePtr texturePtr( &GetImplementation( texture ) );
73 GetImplementation(*this).AttachColorTexture( texturePtr, mipmapLevel, layer );
77 Texture FrameBuffer::GetColorTexture()
79 Internal::NewTexture* texturePtr = GetImplementation(*this).GetColorTexture();
80 return Dali::Texture( texturePtr );