0
私は今、本を読んでいます。 OpenGlについてテクスチャを悪魔で読み込む例があります。 本のコードを1:1から実装しました。しかし、iluFlipImage関数はグラフィカルな問題を引き起こします。 TOAフレームワーク2.1iluFlipImageでグラフィックの問題が発生する
との.NET Framework 4.0を使用して Imが
を反転しない
を反転しました
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));
}