Exemple #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TextureRectangle"/> class.
        /// </summary>
        /// <param name="texture">The texture.</param>
        public TextureRectangle(Texture2D texture)
        {
            if (texture == null)
            {
                throw new ArgumentNullException(nameof(texture));
            }

            this.Texture = texture;
        }
Exemple #2
0
        /// <summary>
        /// Sets the uniform value.
        /// </summary>
        /// <param name="name">The uniform name.</param>
        /// <param name="value">The uniform value.</param>
        /// <returns>Reference to self for method call chaining.</returns>
        IShaderUniform IShaderUniform.SetUniform(string name, Texture2D value)
        {
            int location;

            if (this.uniformLocations.TryGetValue(name, out location))
            {
                if (value.IsInitialized())
                {
                    gl.Uniform1(location, value.Use());
                }
                else
                {
                    gl.Uniform1(location, Texture2D.Default.Use());
                }
            }

            return this;
        }
Exemple #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BitmapGlyph"/> class.
 /// </summary>
 /// <param name="texture">The glyph sheet texture.</param>
 /// <param name="characters">The characters.</param>
 /// <param name="kerning">The kerning values.</param>
 internal BitmapGlyph(Texture2D texture, char[] characters, float[] kerning) : base(texture)
 {
     this.characters = characters;
     this.kerning = kerning;
 }