Example #1
0
        protected FrameBuffer(int width, int height, FramebufferAttachment framebufferAttachment, TextureOptions options)
        {
            GLFramebuffer = new GLFramebuffer();
            GLTexture     = new GLTexture2D(width, height, options: options);

            GLFramebuffer.Bind();
            GLFramebuffer.SetTexture(GLTexture, framebufferAttachment);
            InitializeReadBuffer(width, height);
            InitializeDrawBuffer(width, height);
            GLFramebuffer.Unbind();
        }
Example #2
0
 public void Unbind()
 {
     GLFramebuffer.Unbind();
 }
Example #3
0
        public void Bind()
        {
            GLFramebuffer.Bind();

            GL.Viewport(0, 0, GLTexture.Width, GLTexture.Height);
        }
Example #4
0
        protected override void InitializeDrawBuffer(int width, int height)
        {
            GLRenderbuffer = new GLRenderbuffer(width, height);

            GLFramebuffer.SetRenderbuffer(GLRenderbuffer, FramebufferAttachment.ColorAttachment0);
        }
Example #5
0
 protected override void InitializeReadBuffer(int width, int height)
 {
     GLFramebuffer.ReadBuffer(ReadBufferMode.None);
 }
Example #6
0
 protected override void InitializeDrawBuffer(int width, int height)
 {
     GLFramebuffer.DrawBuffer(DrawBufferMode.None);
 }