2 * Copyright(c) 2019 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.
18 using System.ComponentModel;
22 /// This will be released at Tizen.NET API Level 6, so currently this would be used as inhouse API.
23 [EditorBrowsable(EditorBrowsableState.Never)]
24 public class FrameBuffer : BaseHandle
27 internal FrameBuffer(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.FrameBuffer.FrameBuffer_SWIGUpcast(cPtr), cMemoryOwn)
31 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(FrameBuffer obj)
33 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
36 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
38 Interop.FrameBuffer.delete_FrameBuffer(swigCPtr);
41 /// <since_tizen> 3 </since_tizen>
42 public class Attachment
44 /// <since_tizen> 3 </since_tizen>
50 DEPTH_STENCIL = DEPTH | STENCIL
54 public FrameBuffer(uint width, uint height, uint attachments) : this(Interop.FrameBuffer.FrameBuffer_New(width, height, attachments), true)
56 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
60 public void AttachColorTexture(Texture texture)
62 Interop.FrameBuffer.FrameBuffer_AttachColorTexture__SWIG_0(swigCPtr, Texture.getCPtr(texture));
63 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
66 public void AttachColorTexture(Texture texture, uint mipmapLevel, uint layer)
68 Interop.FrameBuffer.FrameBuffer_AttachColorTexture__SWIG_1(swigCPtr, Texture.getCPtr(texture), mipmapLevel, layer);
69 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
72 public Texture GetColorTexture()
74 //to fix memory leak issue, match the handle count with native side.
75 global::System.IntPtr cPtr = Interop.FrameBuffer.FrameBuffer_GetColorTexture(swigCPtr);
76 Texture ret = this.GetInstanceSafely<Texture>(cPtr);
77 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();