0
我现在读了一本书。它关于OpenGl。有一个例子来加载与魔鬼纹理。 我已经实现了书1:1中的代码。但iluFlipImage函数会导致图形问题。 林使用.NET Framework 4.0 TOA框架2.1iluFlipImage导致图形问题
翻转
不翻转
public void LoadTexture(string textureName, string path)
{
int devIlId;
Il.ilGenImages(1, out devIlId);
Gl.glBindTexture(Gl.GL_TEXTURE_2D, devIlId);
if (!Il.ilLoadImage(path))
{
System.Diagnostics.Debug.Assert(false,
"Could not open file, [" + path + "].");
}
Ilu.iluFlipImage();
var width = Il.ilGetInteger(Il.IL_IMAGE_WIDTH);
var height = Il.ilGetInteger(Il.IL_IMAGE_HEIGHT);
var textureId = Ilut.ilutGLBindTexImage();
System.Diagnostics.Debug.Assert(textureId != 0);
Il.ilDeleteImages(1, ref devIlId);
_textureStorage.Add(textureName, new Texture(textureId, path, width, height));
}