+ context.FramebufferTexture2D( GL_FRAMEBUFFER, iAttachment, GL_TEXTURE_CUBE_MAP_POSITIVE_X + layer, textureId, mipmapLevel );
+ }
+
+ ++mColorAttachmentCount;
+ context.DrawBuffers(mColorAttachmentCount, COLOR_ATTACHMENTS);
+ DALI_ASSERT_DEBUG(context.CheckFramebufferStatus(GL_FRAMEBUFFER) == GL_FRAMEBUFFER_COMPLETE);
+
+ context.BindFramebuffer( GL_FRAMEBUFFER, 0 );
+}
+
+void TextureFrameBuffer::AttachDepthTexture( Context& context, Render::Texture* texture, uint32_t mipmapLevel )
+{
+ context.BindFramebuffer( GL_FRAMEBUFFER, mId );
+
+ // Create a depth attachment.
+ if( texture->GetType() == TextureType::TEXTURE_2D )
+ {
+ context.FramebufferTexture2D( GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, texture->GetId(), mipmapLevel );
+ }
+
+ context.BindFramebuffer( GL_FRAMEBUFFER, 0 );
+}
+
+void TextureFrameBuffer::AttachDepthStencilTexture( Context& context, Render::Texture* texture, uint32_t mipmapLevel )
+{
+ context.BindFramebuffer( GL_FRAMEBUFFER, mId );
+
+ // Create a stencil attachment.
+ if( texture->GetType() == TextureType::TEXTURE_2D )
+ {
+ context.FramebufferTexture2D( GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_TEXTURE_2D, texture->GetId(), mipmapLevel );