Advertisement Jump to content
Sign in to follow this  
DarkCybo1

Problem with OpenIL..

This topic is 4933 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

I can load textures fine when their size is 256, 256 or below. But I tried loading several different images with the size of (512, 512), but it seg faulted on me. Does OpenIL only load textures with a maximum size of 256, 256?

Share this post


Link to post
Share on other sites
Advertisement
Hey what's up. I am using DevIL/OpenIL in my engine, but honestly I've never tried anything over 256x256 until you posted. Well I resized a PNG graphic to 512x512 and DevIL loaded it fine.

I'm running Win32 using SDL/OpenGL with VC7 compiler.

Share this post


Link to post
Share on other sites
I let DevIL do all the work for me. Here's my code.

gameloop.cpp / GameInit ():

// Initialize DevIL
ilInit ();
iluInit ();
ilutInit ();
ilutRenderer (ILUT_OPENGL);



gameres.cpp / BodLoadObject ():

// Read object file header
if (!GetLine (Buffer, 256, fp))
{
fclose (fp);
return (0);
}
sscanf (Buffer, "%s %d %d %d", TextureFile, &NumVerts, &NumTVerts, &NumPolys);
Object->texture = ilutGLLoadImage (TextureFile);



gameres.cpp / BwdLoadWorld ():

for (i = 0; i < NumTexs; i++)
{
if (!GetLine (Buffer, 256, fp))
{
fclose (fp);
return (0);
}
sscanf (Buffer, "%s", TextureFile);
sector01.texture = ilutGLLoadImage (TextureFile);
}



And that's all the code I have pertaining to texture loading.

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!