Пример #1
0
        public TextureGL AttachTexture(
            FramebufferAttachment attachment,
            PixelFormat format,
            PixelInternalFormat internalFormat
            )
        {
            TextureGL texture = new TextureGL(viewport.Width, viewport.Height, format, internalFormat);

            textures[attachment] = texture;
            AttachTextureLevel(attachment, 0);
            return(texture);
        }
Пример #2
0
        public TextureGL AttachTextureArray(
            FramebufferAttachment attachment,
            PixelFormat format,
            PixelInternalFormat internalFormat,
            int layerCount
            )
        {
            TextureGL texture = new TextureGL(viewport.Width, viewport.Height, format, internalFormat, layerCount);

            textures[attachment] = texture;
            AttachTextureLayer(attachment, 0, 0);
            return(texture);
        }
Пример #3
0
        public int CompareTo(object o)
        {
            TextureGL other = (TextureGL)o;

            if (
                (textureObject == other.textureObject) &&
                (BindTarget == other.BindTarget)
                )
            {
                return(0);
            }
            return(-1);
        }
Пример #4
0
        public TextureGL AttachCubeTexture(
            FramebufferAttachment attachment,
            PixelFormat format,
            PixelInternalFormat internalFormat
            )
        {
            if (viewport.Width != viewport.Height)
            {
                throw new System.InvalidOperationException();
            }
            TextureGL texture = new TextureGL(viewport.Width, format, internalFormat);

            textures[attachment] = texture;
            AttachCubeFace(attachment, TextureTarget.TextureCubeMapNegativeX, 0);
            return(texture);
        }
Пример #5
0
        public void AttachCubeFace(
            FramebufferAttachment attachment,
            TextureTarget face,
            int level
            )
        {
            textures[attachment].Apply();
            GL.BindFramebuffer(FramebufferTarget.Framebuffer, framebufferObject);
            TextureGL texture = textures[attachment];

            texture.FramebufferTexture2D(
                FramebufferTarget.Framebuffer,
                attachment,
                face,
                level
                );
        }
Пример #6
0
        public void CopyFrom(IUniformValue src)
        {
            TextureGL other = (TextureGL)src;

            textureObject = other.textureObject;
        }