Beispiel #1
0
        public void SetRenderTargetGL20(RenderTarget2D rendertarget)
        {
            if (rendertarget == null)
            {
                GL20.BindFramebuffer(All20.Framebuffer, framebufferScreen);
                defaultFramebuffer = true;
            }
            else
            {
                GL20.BindFramebuffer(All20.Framebuffer, rendertarget.framebuffer);
                GL20.FramebufferTexture2D(All20.Framebuffer, All20.ColorAttachment0, All20.Texture2D, rendertarget.ID, 0);

                All20 status = GL20.CheckFramebufferStatus(All20.Framebuffer);
                if (status != All20.FramebufferComplete)
                {
                    throw new Exception("Error creating framebuffer: " + status);
                }
                defaultFramebuffer = false;
            }
        }
Beispiel #2
0
 public override void BindToFramebuffer(All attachment, int zoffset)
 {
     GL.FramebufferTexture2D(All.Framebuffer, attachment, this.faceTarget, this.textureID, this.level);
     GLES2Config.GlCheckError(this);
 }