示例#1
0
文件: Texture2D.cs 项目: xxami/Pulsus
        public Texture2D(string path, TextureFlags flags = TextureFlags.None, TextureFormat format = TextureFormat.BGRA8)
        {
#if DEBUG
            this.path = System.IO.Path.GetFileNameWithoutExtension(path);
#endif
            int    width, height, bytesPerPixel;
            byte[] data = FFmpegHelper.ImageFromFile(path, out width, out height, out bytesPerPixel);
            handle = Texture.Create2D(width, height, 0, format, flags, MemoryBlock.FromArray(data));
        }