internal FrameBuffer(string name, int id) : base(name, id, GraphicsResourceType.FrameBuffer) { m_IsBound = false; m_LastBoundTarget = FrameBufferTarget.Both; m_Textures = new List<TextureAttachment>(); }
public void Bind(FrameBufferTarget fbt) { Unbind(); m_IsBound = true; m_LastBoundTarget = fbt; foreach (TextureAttachment ta in m_Textures) ta.tex.Unbind(); GL.BindFramebuffer((FramebufferTarget)fbt, ID); }
public void Unbind() { if(m_IsBound) { GL.BindFramebuffer((FramebufferTarget)m_LastBoundTarget, 0); m_IsBound = false; m_LastBoundTarget = FrameBufferTarget.Both; } }