it isn't possible to load texture using this library
A full featured cross-platform image library
Brought to you by:
doomwiz
I am angry, I lost 2 days for this library. Now I am sure IT ISN'T POSSIBLE TO LOAD JPG/BMP/PNG FILES using this library IN VISUAL STUDIO 2010 !! ilLoadImage throws error: IL_INVALID_EXTENSION ! Am I lonly with this error - NO - here are relative topics:
http://sourceforge.net/projects/openil/forums/forum/13560/topic/4045391
http://sourceforge.net/tracker/?func=detail&aid=2990437&group_id=4470&atid=204470
http://www.gamedev.net/topic/586783-need-help-using-soil/
and much more
What are doing authors to correct this bug ? ANSWER: NOTHING ! I have been written to them and 0 answer.
Now I use SDL library which works !
View and moderate all "support-requests Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Support Requests"
I don't know how its done in visual studio 2010
because i use Code::Blocks
here is how i would set it up.
Linker:
DevIL
ilu
ilut
Includes:
#include <il/il.h>
#include <il/ilu.h>
#include <il/ilut.h>
/// That is how i have my devil lib set up
and before i make any calls to devIL function
you must first call:
ilInit();
iluInit();
ilutRenderer(ILUT_OPENGL);
here is an example code for loading a png file
with devil.
---------------------------------------------
string filename = "NeedToLoad.png";
ILuint ilTexture;
unsigned int texID;
ilGenImages(1, &ilTexture);
ilBindImage(ilTexture);
if (!ilLoadImage((const char*)filename.data()))
{
const char *ret = iluErrorString(ilGetError());
fprintf(stdout,"fail Load ret = %s\n",ret);
}
if(ilConvertImage(IL_RGBA, IL_UNSIGNED_BYTE))
{
width = ilGetInteger(IL_IMAGE_WIDTH);
height = ilGetInteger(IL_IMAGE_HEIGHT);
glGenTextures(1, &texID);
glBindTexture(GL_TEXTURE_2D, texID);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);// NULLed 6.15.2011 GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);//GL_CLAMP);
glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST);
glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST);
format = ilGetInteger(IL_IMAGE_FORMAT);
glTexImage2D(GL_TEXTURE_2D, 0, ilGetInteger(IL_IMAGE_BPP), width, height, 0, ilGetInteger(IL_IMAGE_FORMAT), GL_UNSIGNED_BYTE, ilGetData());
}else
{
fprintf(stdout,"failed\n");
}
ilDeleteImages(1, &ilTexture);
--------------------------------------------------
if you have any more questions just ask
Ive been using sdl with openIL for a while now, currently developing a game engine with a GUI based IDE for Users->Noobs();
Comment->Later("C Ya\n");
Last edit: Anonymous 2013-11-26