public virtual void LoadFromFile(string file) { var bin = new BinaryReader(FileSystem.OpenFile(file)); var sst = new SSTReader(bin); LoadFromSST(sst); }
//TODO:需要实现各种压缩格式的加载 protected void LoadFromSST(SSTReader sst) { BindTexture(); var texSize = sst.Size; GL.TexImage2D(TextureTarget2d.Texture2D, 0, TextureComponentCount.Rgba, (int)texSize.X, (int)texSize.Y, 0, PixelFormat.Rgba, PixelType.Byte, sst.Data); GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (int)TextureMagFilter.Linear); GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.Linear); }