GLUT init code.
if(ilGetInteger(IL_VERSION_NUM) < IL_VERSION || iluGetInteger(ILU_VERSION_NUM) < ILU_VERSION || ilutGetInteger(ILUT_VERSION_NUM) < ILUT_VERSION) { printf("DevIL version mismatch.\n");}ilInit();iluInit();ilutInit();ilutRenderer(ILUT_OPENGL);ILenum devilError = ilGetError();if (devilError != IL_NO_ERROR) cout << "Devil Error: " << iluErrorString(devilError) << endl;GlutMainLoop();
Now the app is running and at some point I call the following function with DevIL code as follows:
GLuint getBackgroundTexture(string path, Vertex* size){ cout << "Start getBackgroundTexture(" << path << ") *********" << endl; ILenum devilError; devilError = ilGetError(); if (devilError != IL_NO_ERROR) { cout << "Start - Devil Error: " << devilError << ", " << iluErrorString(devilError) << endl; } // Load image data from image file. ILuint imageID; ilGenImages(1, &imageID); devilError = ilGetError(); if (devilError != IL_NO_ERROR) { cout << "After gen image - Devil Error: " << devilError << ", " << iluErrorString(devilError) << endl; } ilBindImage(imageID); devilError = ilGetError(); if (devilError != IL_NO_ERROR) { cout << "After bind image - Devil Error: " << devilError << ", " << iluErrorString(devilError) << endl; } if(!ilLoadImage(path.c_str())) // This always fails { devilError = ilGetError(); cout << "After load image - Devil Error: " << devilError << ", " << iluErrorString(devilError) << endl; ilDeleteImages(1, &imageID); return -1; } // Generate a texture from the image data. GLuint openglID; openglID = ilutGLBindTexImage(); devilError = ilGetError(); if (devilError != IL_NO_ERROR) { cout << "After load image - Devil Error: " << devilError << ", " << iluErrorString(devilError) << endl; } // Set the image origin to the lower left. ilEnable(IL_ORIGIN_SET); ilOriginFunc(IL_ORIGIN_LOWER_LEFT); if (devilError != IL_NO_ERROR) { cout << "After origin set - Devil Error: " << devilError << ", " << iluErrorString(devilError) << endl; } return openglID;}
The output from the iluErrorString statements is always i or c.
Any ideas would be appreciated!