Ejemplo n.º 1
0
 internal static void Attach(FramebufferAttachment attachPoint, Texture2D texture)
 {
     if (texture != null)
     {
         // TODO:  Mipmap level
         Texture2DGL3x textureGL = (Texture2DGL3x)texture;
         GL.FramebufferTexture(FramebufferTarget.Framebuffer, attachPoint, textureGL.Handle.Value, 0);
     }
     else
     {
         GL.FramebufferTexture(FramebufferTarget.Framebuffer, attachPoint, 0, 0);
     }
 }
Ejemplo n.º 2
0
        public void Clean()
        {
            if (_dirtyFlags != DirtyFlags.None)
            {
                Validate();

                GL.ActiveTexture(_textureUnit);

                if ((_dirtyFlags & DirtyFlags.Texture) == DirtyFlags.Texture)
                {
                    if (_texture != null)
                    {
                        _texture.Bind();
                    }
                    else
                    {
                        Texture2DGL3x.UnBind(TextureTarget.Texture2D);
                        Texture2DGL3x.UnBind(TextureTarget.TextureRectangle);
                    }
                }

                if ((_dirtyFlags & DirtyFlags.TextureSampler) == DirtyFlags.TextureSampler)
                {
                    if (_textureSampler != null)
                    {
                        _textureSampler.Bind(_textureUnitIndex);
                    }
                    else
                    {
                        TextureSamplerGL3x.UnBind(_textureUnitIndex);
                    }
                }

                _dirtyFlags = DirtyFlags.None;
            }
        }