From 9c19b21ffb5c73031a27f7aa9e4a96dd73bb455e Mon Sep 17 00:00:00 2001 From: Harrison Date: Fri, 17 Apr 2020 22:07:38 -0500 Subject: [PATCH] Removed PNG loader from the TextureData. In support of new loading pipeline. --- RecrownedGTK/Graphics/TextureData.cs | 33 ---------------------------- 1 file changed, 33 deletions(-) diff --git a/RecrownedGTK/Graphics/TextureData.cs b/RecrownedGTK/Graphics/TextureData.cs index 4cd5351..41e9db9 100644 --- a/RecrownedGTK/Graphics/TextureData.cs +++ b/RecrownedGTK/Graphics/TextureData.cs @@ -16,17 +16,6 @@ namespace RecrownedGTK.Graphics { public Color4 borderColor; public TextureMinFilter textureMinFilter; public TextureMagFilter textureMagFilter; - - /// - /// Generates a texture data with a png. - /// - /// A path to a texture represented in PNG format. - public TextureData(string path) { - int width; - int height; - byte[] textureData = LoadPNG(path, out width, out height); - GenerateTexture(textureData, width, height); - } /// /// Generates a texture using a byte array of the texture data. @@ -43,28 +32,6 @@ namespace RecrownedGTK.Graphics { this.height = height; GenerateTexture(textureData, width, height); } - - /// - ///Load PNG data to this texture representation. - /// - /// Decodes the PNG into a byte array to be stored. - /// - /// The path to the PNG file to be represented. - /// Outputs the width of the PNG file. - /// Outputs the height of the PNG file. - /// A byte array representing the PNG. - private byte[] LoadPNG(string path, out int width, out int height) { - byte[] textureData = null; - using (FileStream file = new FileStream(path, FileMode.Open)) { - using (Bitmap bitmap = new Bitmap(file)) { - ImageConverter converter = new ImageConverter(); - textureData = (byte[]) converter.ConvertTo(bitmap, typeof(byte[])); - width = bitmap.Width; - height = bitmap.Height; - } - } - return textureData; - } /// /// Generates a texture in the OpenGL context.