Jump to content
  • Advertisement
Sign in to follow this  
Etyrn

OpenGL Recommended for texturing?

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

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

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites
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... :)

Share this post


Link to post
Share on other sites
Quote:
Original post by iNsAn1tY
EDIT: Damn, beaten... :)

Sorry... :) Your reply is more in-depth, however!

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!