示例#1
0
        /// <summary>
        /// Create new 2d KtxStructure from existing data
        /// </summary>
        /// <param name="glDataType">GlDataType</param>
        /// <param name="glPixelFormat">GlPixelFormat</param>
        /// <param name="glInternalFormat">GlInternalFormat</param>
        /// <param name="width">Width</param>
        /// <param name="height">Height</param>
        /// <param name="textureDatas">Texture datas</param>
        /// <param name="metadata">metadata</param>
        /// <returns>KtxStructure</returns>
        public static KtxStructure Create(GlDataType glDataType, GlPixelFormat glPixelFormat, GlInternalFormat glInternalFormat, uint width, uint height, List <byte[]> textureDatas, Dictionary <string, MetadataValue> metadata)
        {
            KtxHeader      header      = new KtxHeader(glDataType, glPixelFormat, glInternalFormat, width, height, (uint)textureDatas.Count, metadata);
            KtxTextureData textureData = new KtxTextureData(textureDatas);

            return(new KtxStructure(header, textureData));
        }
示例#2
0
        public static KtxStructure LoadInput(MemoryStream memoryStream)
        {
            // First we read the header
            KtxHeader header = new KtxHeader(memoryStream);
            // Then texture data
            KtxTextureData textureData = new KtxTextureData(header, memoryStream);

            // And combine those to one structure
            return(new KtxStructure(header, textureData));
        }