Exemplo n.º 1
0
        // This constructor is reserved for the content loader, it's signature should not be changed
        internal Texture(string file, TextureCreateOptions createOptions)
        {
            _createOptions = createOptions;

            // Create a temporary dynamic texture so we can load the file and read the pixel data
            using (DynamicTexture temp = new DynamicTexture(file))
            {
                Size = new IntVector2(temp.Size.X, temp.Size.Y);
                // Load the texture into gl
                LoadTexture(temp.ReadBytes());
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Create a new texture
 /// </summary>
 /// <param name="dynamicTexture">The dynamic texture to copy the pixel data from</param>
 /// <param name="createOptions">The create options</param>
 public Texture(DynamicTexture dynamicTexture, TextureCreateOptions createOptions)
 {
     _createOptions = createOptions;
     Size           = new IntVector2(dynamicTexture.Size.X, dynamicTexture.Size.Y);
     LoadTexture(dynamicTexture.ReadBytes());
 }