Пример #1
0
        public void AttachTextureImage(FramebufferAttachmentPoint attachmentPoint, ITexture2DMultisample texture)
        {
            var newDesc = new FramebufferAttachmentDescription
            {
                Type          = FramebufferAttachmentType.Texture,
                TextureTarget = TextureTarget.Texture2DMultisample,
                Texture       = texture
            };

            if (IsRedundant(attachmentPoint, ref newDesc))
            {
                return;
            }
            var framebufferTarget = context.Bindings.Framebuffers.EditingTarget;

            context.Bindings.Framebuffers.ByTarget(framebufferTarget).Set(this);
            //gl.FramebufferTexture((int)framebufferTarget, (int)attachmentPoint, texture.Handle, 0);
            GL.FramebufferTexture2D((int)framebufferTarget, (int)attachmentPoint, (int)texture.Target, texture.Handle, 0);
            UpdateStoredDescription(attachmentPoint, ref newDesc);
        }
Пример #2
0
        public void AttachTextureImage(FramebufferAttachmentPoint attachmentPoint, ITexture2DMultisample texture)
        {
            var newDesc = new FramebufferAttachmentDescription
            {
                Type = FramebufferAttachmentType.Texture,
                TextureTarget = TextureTarget.Texture2DMultisample,
                Texture = texture
            };

            if (IsRedundant(attachmentPoint, ref newDesc))
                return;
            var framebufferTarget = context.Bindings.Framebuffers.EditingTarget;
            context.Bindings.Framebuffers.ByTarget(framebufferTarget).Set(this);
            //gl.FramebufferTexture((int)framebufferTarget, (int)attachmentPoint, texture.Handle, 0);
            GL.FramebufferTexture2D((int)framebufferTarget, (int)attachmentPoint, (int)texture.Target, texture.Handle, 0);
            UpdateStoredDescription(attachmentPoint, ref newDesc);
        }