Recommended for texturing?

Started by
3 comments, last by GameDev.net 17 years, 11 months ago
Yar. Well, here's the story. Me and my friend be making a game as a fun little side project together... for a short while we've been using SDL, but the problem with that is it's well... a lot slower than a game could be. I tried out some OpenGL, and my FPS tripled as well as loading time was halved. So now I'm onto OpenGL and GLUT. That's coming along fairly well. My question here is, what would you recommend for texturing? I tried the one from Nehe's tutorial, and yes that could work. Though it's only for .bmp's of 64x64, 128x128, 256x256. Say I wanted to load something of... 32x32. 'Course could always clip a larger one using several sprites (yeh, it's 2D), but I was wondering if there's also an available library for loading textures from files other than .bmps? Preferrably .png's. ANYways... I'm probably rambling here. So all summed up: what do you recommend I use for texturing? Any and all help is appreciated! -Etyrn
Advertisement
If you just want to add support for .pngs, you might to take a look at libpng.

However, something more generalized which handles multiple formats and is rather easy to use is DevIL.

Good luck!
First of all, I'd recommend against using GLUT. It's a test platform for learning OpenGL and rapidly prototyping ideas, not for creating games. NeHe has example code for setting up OpenGL in all of the major OS environments. Pick the one for the OS you're using, and use that as a base for your game code. It'll take a bit of learning, but you'll find it a lot more powerful and flexible than GLUT. Or move back to SDL.

To answer your texturing question, there are a number of decent libraries out there for loading images. There are relatively low-level libraries for some of the more complex individual image formats, like libpng and libjpeg, and higher-level libraries for loading a range of image formats, like DevIL. Some image formats, like bitmaps and Targa Truevision files (TGAs), don't have a dedicated library; you simply load them like you would any other file, and process them accordingly.

I'd recommend taking a look at DevIL.

EDIT: Damn, beaten... :)
My opinion is a recombination and regurgitation of the opinions of those around me. I bring nothing new to the table, and as such, can be safely ignored.[ Useful things - Firefox | GLee | Boost | DevIL ]
Quote:Original post by iNsAn1tY
EDIT: Damn, beaten... :)

Sorry... :) Your reply is more in-depth, however!
Alrighty, well thanks a bunch for your help. I'll take a look into DevIl and possibly libpng, too. As well as Nehe's tutorial on cross platforming OpenGL. ;)


-Etyrn

This topic is closed to new replies.

Advertisement