summaryrefslogtreecommitdiff
path: root/NW4RTools/Models/OpenGL/GLTexture.cs
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2011-02-28 03:23:02 +0100
committerTreeki <treeki@gmail.com>2011-02-28 03:23:02 +0100
commit6b14bc71cb699b72ca6cf164b7b800add414dec6 (patch)
tree414bc20c8af5ae1373a4a15ddaaf2f706e3cb75f /NW4RTools/Models/OpenGL/GLTexture.cs
parent00e977b3dbb8f447b034b7be387ee1a1cce0598c (diff)
downloadnw4rtools-6b14bc71cb699b72ca6cf164b7b800add414dec6.tar.gz
nw4rtools-6b14bc71cb699b72ca6cf164b7b800add414dec6.zip
progress on writing: offset calculation for models and textures complete!
Diffstat (limited to 'NW4RTools/Models/OpenGL/GLTexture.cs')
-rw-r--r--NW4RTools/Models/OpenGL/GLTexture.cs10
1 files changed, 6 insertions, 4 deletions
diff --git a/NW4RTools/Models/OpenGL/GLTexture.cs b/NW4RTools/Models/OpenGL/GLTexture.cs
index c4cdee6..d56d6ca 100644
--- a/NW4RTools/Models/OpenGL/GLTexture.cs
+++ b/NW4RTools/Models/OpenGL/GLTexture.cs
@@ -26,16 +26,18 @@ namespace NW4RTools.Models.OpenGL {
//byte[] pixelData = new byte[tex.BaseImage.Width * tex.BaseImage.Height * 4];
- var lb = tex.BaseImage.LockBits(
- new System.Drawing.Rectangle(0, 0, tex.BaseImage.Width, tex.BaseImage.Height),
+ // TODO: mipmaps
+
+ var lb = tex.Images[0].LockBits(
+ new System.Drawing.Rectangle(0, 0, tex.Images[0].Width, tex.Images[0].Height),
System.Drawing.Imaging.ImageLockMode.ReadOnly,
System.Drawing.Imaging.PixelFormat.Format32bppArgb);
GL.TexImage2D(TextureTarget.Texture2D, 0, PixelInternalFormat.Four,
- tex.BaseImage.Width, tex.BaseImage.Height, 0,
+ tex.Images[0].Width, tex.Images[0].Height, 0,
PixelFormat.Bgra, PixelType.UnsignedByte, lb.Scan0);
- tex.BaseImage.UnlockBits(lb);
+ tex.Images[0].UnlockBits(lb);
}
public void Bind(TextureTarget target) {