Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/opengl/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 恶魔伊洛德错误1285_C++_Opengl_Loading_Textures_Devil - Fatal编程技术网

C++ 恶魔伊洛德错误1285

C++ 恶魔伊洛德错误1285,c++,opengl,loading,textures,devil,C++,Opengl,Loading,Textures,Devil,我在使用devIL for openGL加载图像时遇到问题 在我项目的前一部分,我打电话给 ilInit(); 在一个函数中,在我调用我的load之后,就像这样 //generate a texture ilGenImages( 1, &uiTextureHandle ); //bind our image ilBindImage( uiTextureHandle ); //load //ilLoad( IL_PNG, (const ILstring)"fake.png" ); i

我在使用devIL for openGL加载图像时遇到问题

在我项目的前一部分,我打电话给

ilInit();
在一个函数中,在我调用我的load之后,就像这样

//generate a texture
ilGenImages( 1, &uiTextureHandle );

//bind our image
ilBindImage( uiTextureHandle );

//load
//ilLoad( IL_PNG, (const ILstring)"fake.png" );
ilLoad( IL_PNG, "fake.png" );
为了跟踪错误,我在每次调用后都放上了“ilGetError()” 除了ilLoad返回1285之外,所有这些都返回0

经过一些搜索,我发现这是一个内存不足的错误

因此,ilLoad始终返回0且未加载

有人知道我在做什么,比如我的装载错误或者我忘记做什么了吗
因为我觉得我可能忘记了什么,这就是1285出现的原因。

内存不足导致
IL\u失败的一个常见原因就是您使用的PNG文件已损坏

但是,1285表示IL\u无效\u值
-表示您给它的路径可能是错误的。尝试绝对路径(记住,除非你使用双斜线,否则C++中的斜杠不好)。
我个人使用魔鬼已经有相当一段时间了,而且我确实喜欢它。不过,我敦促您考虑FrimI图。它有更多的开发,而且非常稳定——我在一个商业引擎中使用它来满足我所有的图像需求,它与DirectX/OpenGL集成得非常好,就像DevIL一样。

我还测试了一下,看看是否可以加载另一种图像格式。我的测试对象是“.bmp”,加载没有给我任何错误