Esempio n. 1
0
        internal FrameBuffer(string name, int id) : base(name, id, GraphicsResourceType.FrameBuffer)
        {
            m_IsBound = false;
            m_LastBoundTarget = FrameBufferTarget.Both;

            m_Textures = new List<TextureAttachment>();
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
 public void Unbind()
 {
     if(m_IsBound)
     {
         GL.BindFramebuffer((FramebufferTarget)m_LastBoundTarget, 0);
         m_IsBound = false;
         m_LastBoundTarget = FrameBufferTarget.Both;
     }
 }