Пример #1
0
        internal GLFrameBuffer(GLRenderBuffer colorBuffer, GLRenderBuffer depthBuffer, FramebufferTarget fbTarget, bool disposeRenderBuffers, GLGraphicsContext context)
            : this(context)
        {
            this.disposeRenderBuffers = disposeRenderBuffers;
            this.colorBuffer = colorBuffer;
            this.depthBuffer = depthBuffer;
            this.fbTarget = fbTarget;

            OGL.BindFramebuffer(fbTarget, fboId);

            OGL.FramebufferRenderbuffer(fbTarget, FramebufferAttachment.ColorAttachment0,
                RenderbufferTarget.Renderbuffer, colorBuffer.Id);
            OGL.FramebufferRenderbuffer(fbTarget, FramebufferAttachment.DepthAttachment,
                RenderbufferTarget.Renderbuffer, depthBuffer.Id);

            FramebufferErrorCode err = OGL.CheckFramebufferStatus(fbTarget);
            switch(err) {
            case FramebufferErrorCode.FramebufferComplete:
                break;
            default:
                this.Dispose();
                throw new Exception(String.Format("Invalid frame buffer status: {0}", err));
            }

            OGL.BindFramebuffer(fbTarget, 0);

            context.CheckForErrorsIfDebugging();
        }
Пример #2
0
 public static void BindFramebuffer(FramebufferTarget target, uint framebuffer)
 {
   if (GraphicsExtensions.UseArbFramebuffer)
     GL.BindFramebuffer(target, framebuffer);
   else
     GL.Ext.BindFramebuffer(target, framebuffer);
 }
Пример #3
0
        public Framebuffer(FramebufferTarget target, int width, int height)
            : this(target)
        {
            this.Width = width;
            this.Height = height;

            this.BufferTextures = new Dictionary<FboAttachment, Texture2D> ();
            this.Attachments = new List<DrawBuffersEnum> ();
        }
Пример #4
0
 public Framebuffer(IOpenGL30 gl, FramebufferTarget target)
 {
     var handle = gl.GenFramebuffer();
     if(handle == 0)
         throw new NoHandleCreatedException();
     _gl = gl;
     _target = target;
     Handle = handle;
 }
Пример #5
0
 /// <summary>
 /// Throws an <see cref="ObjectNotBoundException"/> if this framebuffer is not the currently active one.
 /// </summary>
 /// <param name="target">The framebuffer target to bind to.</param>
 public void AssertActive(FramebufferTarget target)
 {
     #if DEBUG
     int activeHandle;
     GetPName binding;
     switch (target)
     {
         case FramebufferTarget.ReadFramebuffer: binding = GetPName.ReadFramebufferBinding; break;
         case FramebufferTarget.DrawFramebuffer: binding = GetPName.DrawFramebufferBinding; break;
         case FramebufferTarget.Framebuffer: binding = GetPName.FramebufferBinding; break;
         default: throw new ArgumentOutOfRangeException();
     }
     GL.GetInteger(binding, out activeHandle);
     if (activeHandle != Handle) throw new ObjectNotBoundException("Can not access an unbound framebuffer. Call Framebuffer.Bind() first.");
     #endif
 }
Пример #6
0
 /// <summary>
 /// Invalidates the contents of a single framebuffer attachement.
 /// </summary>
 /// <param name="target"></param>
 /// <param name="attachment"></param>
 public static void InvalidateFramebuffer(FramebufferTarget target, FramebufferAttachmentType attachment)
 {
     Delegates.glInvalidateFramebuffer(target, 1, ref attachment);
 }
Пример #7
0
 public Framebuffer(FramebufferTarget target)
 {
     _target = target;
     _glFramebuffer = GL.GenFramebuffer ();
 }
 public void BindFramebuffer(FramebufferTarget target, int framebuffer)
 {
     GL.BindFramebuffer(target, framebuffer);
 }
Пример #9
0
 public static void BindBuffer(int buffer = 0, FramebufferTarget target = FramebufferTarget.Framebuffer)
 {
     GL.BindFramebuffer(target, buffer);
 }
Пример #10
0
 public static void FramebufferTexture2D(FramebufferTarget target, FramebufferAttachment attachment, TextureTarget textarget, int texture, int level)
 {
   if (GraphicsExtensions.UseArbFramebuffer)
     GL.FramebufferTexture2D(target, attachment, textarget, texture, level);
   else
     GL.Ext.FramebufferTexture2D(target, attachment, textarget, texture, level);
 }
Пример #11
0
 /// <summary>
 /// Retrives parameters from a named framebuffer.
 /// </summary>
 /// <param name="FramebufferID">id of framebuffer to retrive from.</param>
 /// <param name="pname">name of parameter to retrive</param>
 /// <returns></returns>
 public static int GetFramebufferParameterivEXT(uint FramebufferID, FramebufferTarget pname)
 {
     int tmp = 0;
     Delegates.glGetFramebufferParameterivEXT(FramebufferID, pname, ref tmp);
     return tmp;
 }
Пример #12
0
 //ARB_geometry_shader4
 /// <summary>
 /// Attaches a texture mipmap level to specified attachment point on framebuffer current bound to specified target.
 /// Simplified version of FrameBufferTexture1D,FrameBufferTexture2D,FrameBufferTexture3D.
 /// </summary>
 /// <param name="target">Framebuffer target with bound framebuffer to attach to.</param>
 /// <param name="attachment">Attachment point on framebuffer to attach to.</param>
 /// <param name="TextureID">Texture id to attach.</param>
 /// <param name="level">Texture Mipmap level to attach.</param>
 /// <remarks>
 /// glFramebufferTexture, glFramebufferTexture1D, glFramebufferTexture2D, and glFramebufferTexture attach a selected mipmap level or image of a texture object as one of the logical buffers of the framebuffer object currently bound to target. target must be GL_DRAW_FRAMEBUFFER, GL_READ_FRAMEBUFFER, or GL_FRAMEBUFFER. GL_FRAMEBUFFER is equivalent to GL_DRAW_FRAMEBUFFER.
 /// attachment specifies the logical attachment of the framebuffer and must be GL_COLOR_ATTACHMENTi, GL_DEPTH_ATTACHMENT, GL_STENCIL_ATTACHMENT or GL_DEPTH_STENCIL_ATTACHMENT. i in GL_COLOR_ATTACHMENTi may range from zero to the value of GL_MAX_COLOR_ATTACHMENTS - 1. Attaching a level of a texture to GL_DEPTH_STENCIL_ATTACHMENT is equivalent to attaching that level to both the GL_DEPTH_ATTACHMENT and the GL_STENCIL_ATTACHMENT attachment points simultaneously.
 /// textarget specifies what type of texture is named by texture, and for cube map textures, specifies the face that is to be attached. If texture is not zero, it must be the name of an existing texture with type textarget, unless it is a cube map texture, in which case textarget must be GL_TEXTURE_CUBE_MAP_POSITIVE_X GL_TEXTURE_CUBE_MAP_NEGATIVE_X, GL_TEXTURE_CUBE_MAP_POSITIVE_Y, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, GL_TEXTURE_CUBE_MAP_POSITIVE_Z, or GL_TEXTURE_CUBE_MAP_NEGATIVE_Z.
 /// If texture is non-zero, the specified level of the texture object named texture is attached to the framebfufer attachment point named by attachment. For glFramebufferTexture1D, glFramebufferTexture2D, and glFramebufferTexture3D, texture must be zero or the name of an existing texture with a target of textarget, or texture must be the name of an existing cube-map texture and textarget must be one of GL_TEXTURE_CUBE_MAP_POSITIVE_X, GL_TEXTURE_CUBE_MAP_POSITIVE_Y, GL_TEXTURE_CUBE_MAP_POSITIVE_Z, GL_TEXTURE_CUBE_MAP_NEGATIVE_X, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, or GL_TEXTURE_CUBE_MAP_NEGATIVE_Z.
 /// If textarget is GL_TEXTURE_RECTANGLE, GL_TEXTURE_2D_MULTISAMPLE, or GL_TEXTURE_2D_MULTISAMPLE_ARRAY, then level must be zero. If textarget is GL_TEXTURE_3D, then level must be greater than or equal to zero and less than or equal to log2 of the value of GL_MAX_3D_TEXTURE_SIZE. If textarget is one of GL_TEXTURE_CUBE_MAP_POSITIVE_X, GL_TEXTURE_CUBE_MAP_POSITIVE_Y, GL_TEXTURE_CUBE_MAP_POSITIVE_Z, GL_TEXTURE_CUBE_MAP_NEGATIVE_X, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, or GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, then level must be greater than or equal to zero and less than or equal to log2 of the value of GL_MAX_CUBE_MAP_TEXTURE_SIZE. For all other values of textarget, level must be greater than or equal to zero and no larger than log2 of the value of GL_MAX_TEXTURE_SIZE.
 /// layer specifies the layer of a 2-dimensional image within a 3-dimensional texture.
 /// For glFramebufferTexture1D, if texture is not zero, then textarget must be GL_TEXTURE_1D. For glFramebufferTexture2D, if texture is not zero, textarget must be one of GL_TEXTURE_2D, GL_TEXTURE_RECTANGLE, GL_TEXTURE_CUBE_MAP_POSITIVE_X, GL_TEXTURE_CUBE_MAP_POSITIVE_Y, GL_TEXTURE_CUBE_MAP_POSITIVE_Z, GL_TEXTURE_CUBE_MAP_NEGATIVE_X, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, or GL_TEXTURE_2D_MULTISAMPLE. For glFramebufferTexture3D, if texture is not zero, then textarget must be GL_TEXTURE_3D.
 /// </remarks>
 public static void FramebufferTexture(FramebufferTarget target, FramebufferAttachmentType attachment, uint TextureID, int level = 0)
 {
     Delegates.glFramebufferTexture(target, attachment, TextureID, level);
 }
Пример #13
0
 /// <summary>
 /// Invalidates subparts of several framebuffer attachments.
 /// </summary>
 /// <param name="target"></param>
 /// <param name="attachments"></param>
 /// <param name="x"></param>
 /// <param name="y"></param>
 /// <param name="width"></param>
 /// <param name="height"></param>
 public static void InvalidateSubFramebuffer(FramebufferTarget target, FramebufferAttachmentType[] attachments, int x, int y, int width, int height)
 {
     Delegates.glInvalidateSubFramebuffer(target, attachments.Length, ref attachments[0], x, y, width, height);
 }
Пример #14
0
 /// <summary>
 /// Invalidates the contents of a single framebuffer attachement.
 /// </summary>
 /// <param name="target"></param>
 /// <param name="attachment"></param>
 public static void InvalidateFramebuffer(FramebufferTarget target, FramebufferAttachmentType attachment)
 {
     Delegates.glInvalidateFramebuffer(target, 1, ref attachment);
 }
Пример #15
0
 /// <summary>
 /// Invalidates the content of a framebuffers attachments.
 /// </summary>
 /// <param name="target"></param>
 /// <param name="attachments"></param>
 public static void InvalidateFramebuffer(FramebufferTarget target, FramebufferAttachmentType[] attachments)
 {
     Delegates.glInvalidateFramebuffer(target, attachments.Length, ref attachments[0]);
 }
Пример #16
0
 public unsafe static uint CheckNamedFramebufferStatus(uint framebuffer, FramebufferTarget target)
 => glCheckNamedFramebufferStatus(framebuffer, target);
Пример #17
0
 public abstract void FramebufferTexture2DMultisample([Flow(FlowDirection.In)] FramebufferTarget target, [Flow(FlowDirection.In)] FramebufferAttachment attachment, [Flow(FlowDirection.In)] TextureTarget textarget, [Flow(FlowDirection.In)] uint texture, [Flow(FlowDirection.In)] int level, [Flow(FlowDirection.In)] uint samples);
 public FramebufferErrorCode CheckFramebufferStatus(FramebufferTarget target)
 {
     return(GL.CheckFramebufferStatus(target));
 }
 public void FramebufferRenderbuffer(
     FramebufferTarget target, FramebufferAttachment attachment, RenderbufferTarget renderbuffertarget, int renderbuffer)
 {
     GL.FramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer);
 }
Пример #20
0
 /// <summary>
 /// Invalidates a subpart of a single framebuffer attachment.
 /// </summary>
 /// <param name="target"></param>
 /// <param name="attachment"></param>
 /// <param name="x"></param>
 /// <param name="y"></param>
 /// <param name="width"></param>
 /// <param name="height"></param>
 public static void InvalidateSubFramebuffer(FramebufferTarget target, FramebufferAttachmentType attachment, int x, int y, int width, int height)
 {
     Delegates.glInvalidateSubFramebuffer(target, 1, ref attachment, x, y, width, height);
 }
Пример #21
0
 /// <summary>
 /// Retrives a parameter value from a framebuffer.
 /// </summary>
 /// <param name="target">id of framebuffer to query.</param>
 /// <param name="pname">Name of parameter to retive.</param>
 /// <param name="params">value of parameter</param>
 public static void GetFramebufferParameteriv(FramebufferTarget target, FramebufferParameters pname, int[] @params)
 {
     Delegates.glGetFramebufferParameteriv(target, pname, ref @params[0]);
 }
Пример #22
0
 /// <summary>
 /// Invalidates a subpart of a single framebuffer attachment.
 /// </summary>
 /// <param name="target"></param>
 /// <param name="attachment"></param>
 /// <param name="x"></param>
 /// <param name="y"></param>
 /// <param name="width"></param>
 /// <param name="height"></param>
 public static void InvalidateSubFramebuffer(FramebufferTarget target, FramebufferAttachmentType attachment, int x, int y, int width, int height)
 {
     Delegates.glInvalidateSubFramebuffer(target, 1, ref attachment, x, y, width, height);
 }
Пример #23
0
 /// <summary>
 /// Checks the completeness of a framebuffer setup.
 /// </summary>
 /// <param name="FramebufferID">id of framebuffer to check.</param>
 /// <param name="fboTarget">Target to check for.</param>
 /// <returns>result</returns>
 public static FramebufferStatus CheckNamedFramebufferStatusEXT(uint FramebufferID, FramebufferTarget fboTarget)
 {
     return Delegates.glCheckNamedFramebufferStatusEXT(FramebufferID, fboTarget);
 }
Пример #24
0
 //ARB_framebuffer_no_attachment
 /// <summary>
 /// Sets a framebuffer parameter.
 /// </summary>
 /// <param name="target">id of framebuffer to set</param>
 /// <param name="pname">Name of parameter to change.</param>
 /// <param name="param">new value of parameter.</param>
 public static void FramebufferParameteri(FramebufferTarget target, FramebufferParameters pname, int param)
 {
     Delegates.glFramebufferParameteri(target, pname, param);
 }
Пример #25
0
 protected bool assertFramebufferOK(FramebufferTarget target)
 {
     var currCode = GL.Ext.CheckFramebufferStatus(target);
     if (currCode != FramebufferErrorCode.FramebufferComplete) {
         Console.WriteLine ("Frame buffer operation failed: " + currCode.ToString ());
         m_isValid = false;
         DeleteData ();
     } else {
         m_isValid = true;
     }
     return m_isValid;
 }
Пример #26
0
 /// <summary>
 /// Retrives a parameter value from a framebuffer.
 /// </summary>
 /// <param name="target">id of framebuffer to query.</param>
 /// <param name="pname">Name of parameter to retive.</param>
 /// <param name="params">value of parameter</param>
 public static void GetFramebufferParameteriv(FramebufferTarget target, FramebufferParameters pname, int[] @params)
 {
     Delegates.glGetFramebufferParameteriv(target, pname, ref @params[0]);
 }
Пример #27
0
 public static void GetFramebufferAttachmentParameter(FramebufferTarget target, FramebufferAttachment attachment, FramebufferParameterName pname, out int @params)
 {
   if (GraphicsExtensions.UseArbFramebuffer)
     GL.GetFramebufferAttachmentParameter(target, attachment, pname, out @params);
   else
     GL.Ext.GetFramebufferAttachmentParameter(target, attachment, pname, out @params);
 }
Пример #28
0
 public void BindDefaultFramebuffer(FramebufferTarget target)
 {
     BindFramebuffer(target, 0);
 }
Пример #29
0
 public static void BindScreenBuffer(FramebufferTarget target = FramebufferTarget.Framebuffer)
 {
     GL.BindFramebuffer(target, 0);
     //GL.DrawBuffer(DrawBufferMode.Back);
 }
Пример #30
0
 public FramebufferStatus CheckFramebufferStatus(FramebufferTarget target)
 {
     return(_glCheckFramebufferStatus(target));
 }
Пример #31
0
 internal void FramebufferRenderbuffer(FramebufferTarget target, FramebufferAttachment attachment, uint renderBuffer)
 {
     _glFramebufferRenderbuffer(target, attachment, RenderbufferBindTarget.Renderbuffer, renderBuffer);
     CheckForError();
 }
Пример #32
0
 internal void FramebufferTexture2D(FramebufferTarget target, FramebufferAttachment attachment, TextureTarget textarget, uint texture)
 {
     _glFramebufferTexture2D(target, attachment, textarget, texture, 0);
     CheckForError();
 }
Пример #33
0
 /// <summary>
 /// Invalidates the content of a framebuffers attachments.
 /// </summary>
 /// <param name="target"></param>
 /// <param name="attachments"></param>
 public static void InvalidateFramebuffer(FramebufferTarget target, FramebufferAttachmentType[] attachments)
 {
     Delegates.glInvalidateFramebuffer(target, attachments.Length, ref attachments[0]);
 }
 public static unsafe void FramebufferSampleLocations(this ArbSampleLocations thisApi, [Flow(FlowDirection.In)] FramebufferTarget target, [Flow(FlowDirection.In)] uint start, [Flow(FlowDirection.In)] uint count, [Flow(FlowDirection.In)] ReadOnlySpan <float> v)
 {
     // SpanOverloader
     thisApi.FramebufferSampleLocations(target, start, count, in v.GetPinnableReference());
 }
Пример #35
0
 /// <summary>
 /// Invalidates subparts of several framebuffer attachments.
 /// </summary>
 /// <param name="target"></param>
 /// <param name="attachments"></param>
 /// <param name="x"></param>
 /// <param name="y"></param>
 /// <param name="width"></param>
 /// <param name="height"></param>
 public static void InvalidateSubFramebuffer(FramebufferTarget target, FramebufferAttachmentType[] attachments, int x, int y, int width, int height)
 {
     Delegates.glInvalidateSubFramebuffer(target, attachments.Length, ref attachments[0], x, y, width, height);
 }
Пример #36
0
 public abstract void BindFramebuffer([Flow(FlowDirection.In)] FramebufferTarget target, [Flow(FlowDirection.In)] uint framebuffer);
Пример #37
0
 //ARB_framebuffer_no_attachment
 /// <summary>
 /// Sets a framebuffer parameter.
 /// </summary>
 /// <param name="target">id of framebuffer to set</param>
 /// <param name="pname">Name of parameter to change.</param>
 /// <param name="param">new value of parameter.</param>
 public static void FramebufferParameteri(FramebufferTarget target, FramebufferParameters pname, int param)
 {
     Delegates.glFramebufferParameteri(target, pname, param);
 }
Пример #38
0
 public abstract EXT CheckFramebufferStatus([Flow(FlowDirection.In)] FramebufferTarget target);
Пример #39
0
 /// <summary>
 /// Retrives a parameter value from a framebuffer.
 /// </summary>
 /// <param name="target">id of framebuffer to query.</param>
 /// <param name="pname">Name of parameter to retive.</param>
 /// <returns>value of parameter</returns>
 public static int GetFramebufferParameteriv(FramebufferTarget target, FramebufferParameters pname)
 {
     int tmp = 0;
     Delegates.glGetFramebufferParameteriv(target, pname, ref tmp);
     return tmp;
 }
Пример #40
0
 public abstract void FramebufferRenderbuffer([Flow(FlowDirection.In)] FramebufferTarget target, [Flow(FlowDirection.In)] FramebufferAttachment attachment, [Flow(FlowDirection.In)] RenderbufferTarget renderbuffertarget, [Flow(FlowDirection.In)] uint renderbuffer);
Пример #41
0
 /// <summary>
 /// glFramebufferTextureLayer operates like glFramebufferTexture, except that only a single layer of the texture level, given by layer, is attached to the attachment point
 /// Attaches a single texture layers mipmap to a specifed attachment point on framebuffer currently bound to specified target.
 /// </summary>
 /// <param name="fboTarget">Framebuffer target with bound framebuffer to attach to.</param>
 /// <param name="attachment">Attachment point on framebuffer to attach to.</param>
 /// <param name="TextureID">Specifies the texture object to attach to the framebuffer attachment point named by attachment.</param>
 /// <param name="level">Specifies the mipmap level of texture to attach.</param>
 /// <param name="Layer">Specifies the layer of texture to attach.</param>
 /// <remarks>
 /// glFramebufferTextureLayer operates like glFramebufferTexture, except that only a single layer of the texture level, given by layer, is attached to the attachment point. If texture is not zero, layer must be greater than or equal to zero. texture must either be zero or the name of an existing three-dimensional texture, one- or two-dimensional array texture, or multisample array texture.
 /// </remarks>
 public static void FramebufferTextureLayer(FramebufferTarget fboTarget, FramebufferAttachmentType attachment, uint TextureID, int level = 0, int Layer= 0)
 {
     Delegates.glFramebufferTextureLayer(fboTarget, attachment, TextureID, level, Layer);
 }
Пример #42
0
 public abstract void FramebufferParameter([Flow(FlowDirection.In)] FramebufferTarget target, [Flow(FlowDirection.In)] FramebufferParameterName pname, [Flow(FlowDirection.In)] int param);
Пример #43
0
 /// <summary>
 /// Retrives parameters from a named framebuffer.
 /// </summary>
 /// <param name="FramebufferID">id of framebuffer to retrive from.</param>
 /// <param name="pname">name of parameter to retrive.</param>
 /// <param name="params">result</param>
 public static void GetFramebufferParameterivEXT(uint FramebufferID, FramebufferTarget pname, int[] @params)
 {
     Delegates.glGetFramebufferParameterivEXT(FramebufferID, pname, ref @params[0]);
 }
Пример #44
0
 public abstract void GetFramebufferParameter([Flow(FlowDirection.In)] FramebufferTarget target, [Flow(FlowDirection.In)] FramebufferAttachmentParameterName pname, [Count(Computed = "pname"), Flow(FlowDirection.Out)] out int @params);
Пример #45
0
 public abstract void FramebufferSampleLocations([Flow(FlowDirection.In)] FramebufferTarget target, [Flow(FlowDirection.In)] uint start, [Flow(FlowDirection.In)] uint count, [Flow(FlowDirection.In)] Span <float> v);
Пример #46
0
 public abstract void FramebufferTexture([Flow(FlowDirection.In)] FramebufferTarget target, [Flow(FlowDirection.In)] FramebufferAttachment attachment, [Flow(FlowDirection.In)] uint texture, [Flow(FlowDirection.In)] int level);
Пример #47
0
 public static FramebufferErrorCode CheckFramebufferStatus(FramebufferTarget target)
 {
   if (!GraphicsExtensions.UseArbFramebuffer)
     return GL.Ext.CheckFramebufferStatus(target);
   else
     return GL.CheckFramebufferStatus(target);
 }
Пример #48
0
 public unsafe static void BindFramebuffer(FramebufferTarget target, uint framebuffer)
 => glBindFramebuffer(target, framebuffer);
Пример #49
0
 public static void FramebufferRenderbuffer(FramebufferTarget target, FramebufferAttachment attachment, RenderbufferTarget renderbuffertarget, uint renderbuffer)
 {
   if (GraphicsExtensions.UseArbFramebuffer)
     GL.FramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer);
   else
     GL.Ext.FramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer);
 }
Пример #50
0
 private Framebuffer(FramebufferTarget target)
 {
     this.FramebufferId = GL.GenFramebuffer ();
     this.Target = target;
 }
Пример #51
0
 public abstract unsafe void FramebufferSampleLocations([Flow(FlowDirection.In)] FramebufferTarget target, [Flow(FlowDirection.In)] uint start, [Flow(FlowDirection.In)] uint count, [Flow(FlowDirection.In)] float *v);
Пример #52
0
 /// <summary>
 /// Draws the shader in its current state to a frame buffer (and associated texture). Useful for precomputation.
 /// </summary>
 public void Draw2DFrame(FramebufferTarget Framebuffer, FramebufferAttachment Attachment, uint Texture, int Width, int Height)
 {
     GL.FramebufferTexture2D(Framebuffer, Attachment, TextureTarget.Texture2D, Texture, 0);
     GL.Viewport(0, 0, Width, Height);
     this.DrawFull();
 }
Пример #53
0
 public static void BindDefaultBuffer(FramebufferTarget target = FramebufferTarget.Framebuffer)
 {
     GL.BindFramebuffer(target, fBOID_I);
 }
Пример #54
0
 public partial void FramebufferTextureMultiview([Flow(FlowDirection.In)] FramebufferTarget target, [Flow(FlowDirection.In)] FramebufferAttachment attachment, [Flow(FlowDirection.In)] uint texture, [Flow(FlowDirection.In)] int level, [Flow(FlowDirection.In)] int baseViewIndex, [Flow(FlowDirection.In)] uint numViews);
Пример #55
0
 public unsafe static FramebufferStatus CheckFramebufferStatus(FramebufferTarget target)
 => glCheckFramebufferStatus(target);
Пример #56
0
 public void Bind(FramebufferTarget target)
 {
     Context.BindFramebuffer(target, Handle);
 }
Пример #57
0
 public IBinding<IFramebuffer> ByTarget(FramebufferTarget target)
 {
     return target == FramebufferTarget.Draw ? Draw : Read;
 }
Пример #58
0
 public unsafe static void FramebufferTexture3D(FramebufferTarget target, FramebufferAttachment attachment, TextureTarget texTarget, uint texture, int level, int zOffset)
 => glFramebufferTexture3D(target, attachment, texTarget, texture, level, zOffset);
Пример #59
0
 /// <summary>
 /// Draws the shader in its current state to a frame buffer (and associated texture). Useful for precomputation. The "Layer" uniform is set
 /// in the shader to indicate depth.
 /// </summary>
 public void Draw3DFrame(FramebufferTarget Framebuffer, FramebufferAttachment Attachment, uint Texture, int Width, int Height, int Depth)
 {
     this.Call();
     int luniform = GL.GetUniformLocation(this.Program, "Layer");
     for (int t = 0; t < Depth; t++)
     {
         GL.FramebufferTexture3D(Framebuffer, Attachment, TextureTarget.Texture3D, Texture, 0, t);
         GL.Viewport(0, 0, Width, Height);
         GL.Uniform1(luniform, t);
         DrawQuad();
     }
 }
 public abstract void DiscardFramebuffer([Flow(FlowDirection.In)] FramebufferTarget target, [Flow(FlowDirection.In)] uint numAttachments, [Count(Parameter = "numAttachments"), Flow(FlowDirection.In)] Span <InvalidateFramebufferAttachment> attachments);