Exemplo n.º 1
0
 public partial void BlitFramebuffer([Flow(FlowDirection.In)] int srcX0, [Flow(FlowDirection.In)] int srcY0, [Flow(FlowDirection.In)] int srcX1, [Flow(FlowDirection.In)] int srcY1, [Flow(FlowDirection.In)] int dstX0, [Flow(FlowDirection.In)] int dstY0, [Flow(FlowDirection.In)] int dstX1, [Flow(FlowDirection.In)] int dstY1, [Flow(FlowDirection.In)] uint mask, [Flow(FlowDirection.In)] BlitFramebufferFilter filter);
Exemplo n.º 2
0
        /// <summary>
        /// Copies content to the specified Framebuffer.
        /// </summary>
        public void CopyTo(Framebuffer target, ClearBufferMask clear = ClearBufferMask.ColorBufferBit, BlitFramebufferFilter filter = BlitFramebufferFilter.Linear)
        {
            Activate(FramebufferTarget.ReadFramebuffer, false);
            target.Activate(FramebufferTarget.DrawFramebuffer, false);

            GL.BlitFramebuffer(0, 0, (int)Size.X, (int)Size.Y, 0, 0, (int)Size.X, (int)Size.Y, clear, filter);
        }
Exemplo n.º 3
0
 ///<summary> Blit from read FB into this, x0/y0/x1/y1 are source area, dx0/dy0/dx1/dy1 are destination area.
 ///Mask indicates what buffer contents are to be copied: GL_COLOR_BUFFER_BIT, GL_DEPTH_BUFFER_BIT and GL_STENCIL_BUFFER_BIT.
 ///Filt is the interpolation filter, GL_NEAREST or GL_LINEAR
 ///</summary>
 public void Blit(GLFrameBuffer read, ReadBufferMode src, int x0, int y0, int x1, int y1, int dx0, int dy0, int dx1, int dy1, ClearBufferMask mask, BlitFramebufferFilter filt)
 {
     GL.NamedFramebufferReadBuffer(read.Id, src);
     GL.BlitNamedFramebuffer(read.Id, Id, x0, y0, x1, y1, dx0, dy0, dx1, dy1, mask, filt);
     GLStatics.Check();
 }
Exemplo n.º 4
0
 public static void BlitFramebuffer(int srcX0, int srcY0, int srcX1, int srcY1, int dstX0, int dstY0, int dstX1, int dstY1, ClearBufferMask mask, BlitFramebufferFilter filter)
 {
     CheckCurrent();
     _bindings.glBlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, (uint)mask, (int)filter);
     CheckError();
 }
Exemplo n.º 5
0
        public void Copy(
            GalImage srcImage,
            GalImage dstImage,
            long srcKey,
            long dstKey,
            int srcLayer,
            int dstLayer,
            int srcX0,
            int srcY0,
            int srcX1,
            int srcY1,
            int dstX0,
            int dstY0,
            int dstX1,
            int dstY1)
        {
            if (_texture.TryGetImageHandler(srcKey, out ImageHandler srcTex) &&
                _texture.TryGetImageHandler(dstKey, out ImageHandler dstTex))
            {
                if (srcTex.HasColor != dstTex.HasColor ||
                    srcTex.HasDepth != dstTex.HasDepth ||
                    srcTex.HasStencil != dstTex.HasStencil)
                {
                    throw new NotImplementedException();
                }

                if (_srcFb == 0)
                {
                    _srcFb = GL.GenFramebuffer();
                }

                if (_dstFb == 0)
                {
                    _dstFb = GL.GenFramebuffer();
                }

                GL.BindFramebuffer(FramebufferTarget.ReadFramebuffer, _srcFb);
                GL.BindFramebuffer(FramebufferTarget.DrawFramebuffer, _dstFb);

                FramebufferAttachment attachment = GetAttachment(srcTex);

                if (ImageUtils.IsArray(srcImage.TextureTarget) && srcLayer > 0)
                {
                    GL.FramebufferTextureLayer(FramebufferTarget.ReadFramebuffer, attachment, srcTex.Handle, 0, srcLayer);
                }
                else
                {
                    GL.FramebufferTexture(FramebufferTarget.ReadFramebuffer, attachment, srcTex.Handle, 0);
                }

                if (ImageUtils.IsArray(dstImage.TextureTarget) && dstLayer > 0)
                {
                    GL.FramebufferTextureLayer(FramebufferTarget.DrawFramebuffer, attachment, dstTex.Handle, 0, dstLayer);
                }
                else
                {
                    GL.FramebufferTexture(FramebufferTarget.DrawFramebuffer, attachment, dstTex.Handle, 0);
                }


                BlitFramebufferFilter filter = BlitFramebufferFilter.Nearest;

                if (srcTex.HasColor)
                {
                    GL.DrawBuffer(DrawBufferMode.ColorAttachment0);

                    filter = BlitFramebufferFilter.Linear;
                }

                ClearBufferMask mask = GetClearMask(srcTex);

                GL.BlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
            }
        }
 public static void BlitFramebufferANGLE(int srcX0, int srcY0, int srcX1, int srcY1, int dstX0, int dstY0, int dstX1, int dstY1, uint mask, BlitFramebufferFilter filter)
 {
     Debug.Assert(Delegates.pglBlitFramebufferANGLE != null, "pglBlitFramebufferANGLE not implemented");
     Delegates.pglBlitFramebufferANGLE(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, (int)filter);
     LogCommand("glBlitFramebufferANGLE", null, srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
     DebugCheckErrors(null);
 }
Exemplo n.º 7
0
 public static void BlitFramebuffer(int srcX0, int srcY0, int srcX1, int srcY1, int dstX0, int dstY0, int dstX1, int dstY1, ClearBufferFlags mask, BlitFramebufferFilter filter)
 {
     Delegates.glBlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
 }
Exemplo n.º 8
0
 public void BlitFramebuffer(IFramebuffer src, IFramebuffer dst, int srcX0, int srcY0, int srcX1, int srcY1, int dstX0, int dstY0, int dstX1, int dstY1, ClearBufferMask mask, BlitFramebufferFilter filter)
 {
     context.Bindings.Framebuffers.Read.Set(src);
     context.Bindings.Framebuffers.Draw.Set(dst);
     context.GL.BlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, (uint)mask, (int)filter);
 }
Exemplo n.º 9
0
 public unsafe static void BlitFramebuffer(int srcX0, int srcY0, int srcX1, int srcY1, int dstX0, int dstY0, int dstX1, int dstY1, ClearBufferMask mask, BlitFramebufferFilter filter)
 => glBlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
Exemplo n.º 10
0
 internal extern static void GLBlitFramebufferExt(int srcX0, int srcY0, int srcX1, int srcY1, int dstX0, int dstY0, int dstX1, int dstY1, ClearBufferMask mask, BlitFramebufferFilter filter);
Exemplo n.º 11
0
 public void BlitFramebuffer(int srcX0, int srcY0, int srcX1, int srcY1, int dstX0, int dstY0, int dstX1, int dstY1, BufferMask mask, BlitFramebufferFilter filter)
 {
     _glBlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
     CheckForError();
 }
Exemplo n.º 12
0
		public static void BlitFramebuffer(int srcX0, int srcY0, int srcX1, int srcY1, int dstX0, int dstY0, int dstX1, int dstY1, ClearBufferMask mask, BlitFramebufferFilter filter)
		{
			glBlitFramebuffer deleg = BaseGraphicsContext.Current.Loader.Get<glBlitFramebuffer>();
			if (deleg != null)
				deleg(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
		}
Exemplo n.º 13
0
 public void Blit(IFramebuffer target, ClearBufferMask mask, BlitFramebufferFilter filter)
 {
     // \todo
 }