コード例 #1
0
            /// <summary>
            /// Construct a ImageTechnique.
            /// </summary>
            /// <param name="texture">
            /// The <see cref="TextureArray2d"/> affected by this Technique.
            /// </param>
            /// <param name="target">
            /// A <see cref="TextureTarget"/> that specify the texture target.
            /// </param>
            /// <param name="pixelFormat">
            /// The <see cref="PixelLayout"/> that specify texture pixel format.
            /// </param>
            /// <param name="images">
            /// A <see cref="Image[]"/> that specify the texture array layers.
            /// </param>
            /// <param name="resetLayers">
            ///
            /// </param>
            public ImageTechnique(TextureArray2d texture, TextureTarget target, PixelLayout pixelFormat, Image[] images, bool resetLayers) :
                base(texture)
            {
                if (images == null)
                {
                    throw new ArgumentNullException("images");
                }
                if (images.Length == 0)
                {
                    throw new ArgumentException("no image layers", "images");
                }
                //if (Array.TrueForAll(images, delegate (Image item) { return ((item == null) || (item.Width == images[0].Width && item.Height == images[0].Height)); }) == false)
                //	throw new ArgumentException("non-uniform image layers extents", "images");

                _TextureArray2d = texture;
                _Target         = target;
                _PixelFormat    = pixelFormat;
                _Images         = images;
                foreach (Image image in images)
                {
                    if (image != null)
                    {
                        image.IncRef();
                    }
                }
                _ResetLayers = resetLayers;
            }
コード例 #2
0
 /// <summary>
 /// Construct a EmptyTechnique.
 /// </summary>
 /// <param name="texture">
 /// The <see cref="TextureArray2d"/> affected by this Technique.
 /// </param>
 /// <param name="target">
 /// A <see cref="TextureTarget"/> that specify the texture target.
 /// </param>
 /// <param name="pixelFormat">
 /// The texture pixel format.
 /// </param>
 /// <param name="width">
 /// The width of the texture.
 /// </param>
 /// <param name="height">
 /// The height of the texture.
 /// </param>
 /// <param name="layers">
 /// A <see cref="UInt32"/> that specify the number of layers defining the texture array.
 /// </param>
 public EmptyTechnique(TextureArray2d texture, TextureTarget target, PixelLayout pixelFormat, uint width, uint height, uint layers) :
     base(texture)
 {
     _TextureArray2d = texture;
     _Target         = target;
     _PixelFormat    = pixelFormat;
     _Width          = width;
     _Height         = height;
     _Layers         = layers;
 }
コード例 #3
0
 public void AttachColor(uint attachmentIndex, TextureArray2d texture, uint layer, uint level)
 {
     AttachColor(attachmentIndex, new TextureArrayAttachment(texture, layer, level));
 }
コード例 #4
0
 /// <summary>
 /// Construct a Texture3dAttachment specifing the texture.
 /// </summary>
 /// <param name="texture">
 /// The <see cref="TextureCube"/> to be attached to a Framebuffer.
 /// </param>
 /// <param name="layer">
 /// A <see cref="UInt32"/> the specify the layer of <paramref name="texture"/> to attach.
 /// </param>
 /// <param name="textureLevel">
 /// A <see cref="UInt32"/> that specify the level of <paramref name="texture"/> to be attached.
 /// </param>
 /// <exception cref="ArgumentNullException">
 /// Exception thrown if <paramref name="texture"/> is null.
 /// </exception>
 public TextureArrayAttachment(TextureArray2d texture, uint layer, uint textureLevel)
     : base(texture, textureLevel)
 {
     Depth = layer;
 }
コード例 #5
0
 /// <summary>
 /// Construct a Texture3dAttachment specifing the texture.
 /// </summary>
 /// <param name="texture">
 /// The <see cref="TextureCube"/> to be attached to a Framebuffer.
 /// </param>
 /// <param name="layer">
 /// A <see cref="UInt32"/> the specify the layer of <paramref name="texture"/> to attach.
 /// </param>
 /// <exception cref="ArgumentNullException">
 /// Exception thrown if <paramref name="texture"/> is null.
 /// </exception>
 public TextureArrayAttachment(TextureArray2d texture, uint layer)
     : this(texture, layer, 0)
 {
 }