Jump to content
  • Advertisement
Sign in to follow this  


This topic is 4004 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi, Im using devil + opengl in my current project to load textures. Everything works as expected but Ive tested it on 3 other computers and on 2 it doesnt show any textures eventhough ilLoadimage returns true and on one it runs incredibly slow. In all cases ilLoadimage returns true. #define NIMAGES 200 ILuint image[NIMAGES]; GLuint texture[NIMAGES]; #define IMG_FONT 0 #define IMG_BG 1 #define IMG_HERO 2 #define IMG_TROOPER 3 #define IMG_ARCHER 4 #define IMG_WIZARD 5 #define IMG_MOUSE 6 #define IMG_STATBARHP 7 #define IMG_STATBARHPSIDES 8 #define IMG_STATBARHPSIDEL 9 #define IMG_STATBARHPSIDER 10 #define IMG_STATBARMANA 11 #define IMG_BULLET 12 #define IMG_ROCKET 13 #define IMG_SHURIKEN 14 #define IMG_TING 15 void LoadTexture(const char *ffname, unsigned int ftexnr) { ilBindImage(image[ftexnr]); glBindTexture(GL_TEXTURE_2D, texture[ftexnr]); if(ilLoadImage(ffname)) { LogW <<ffname << " loaded."<<endl; ilConvertImage(IL_RGBA, IL_UNSIGNED_BYTE); } else {LogW << "Couldnt load image: " << ffname <<endl;} glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexImage2D(GL_TEXTURE_2D, 0, ilGetInteger(IL_IMAGE_BPP), ilGetInteger(IL_IMAGE_WIDTH), ilGetInteger(IL_IMAGE_HEIGHT), 0, ilGetInteger(IL_IMAGE_FORMAT), GL_UNSIGNED_BYTE, ilGetData()); } Init() { ilInit(); iluInit(); ilutRenderer(ILUT_OPENGL); //ilEnable (IL_CONV_PAL); ilutEnable(ILUT_OPENGL_CONV); ilGenImages(NIMAGES,&image[0]); glGenTextures(NIMAGES,&texture[0]); LoadTexture("font0.png",IMG_FONT); LoadTexture("bg0.tga",IMG_BG); LoadTexture("greenknight.tga",IMG_HERO); LoadTexture("staffdude.tga",IMG_TROOPER); LoadTexture("mouse1.tga",IMG_MOUSE); LoadTexture("hpbar.tga",IMG_STATBARHP); LoadTexture("ting2.png",IMG_TING); LoadTexture("hpbarsidel.tga",IMG_STATBARHPSIDEL); LoadTexture("hpbarsider.tga",IMG_STATBARHPSIDER); LoadTexture("manabar.tga",IMG_STATBARMANA); LoadTexture("bullet.tga",IMG_BULLET); } any kind of help is welcome, ty.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!