Skip to main content
gamedev.net
🔒 Locked

Best texture format

Started by Alpha Nox Jun 23, 2007 at 3:51 PM 2 replies 1k views
Original Post
Alpha Nox
Alpha Nox
Hello everyone, I'm really new to OpenGL and I was wondering what texture format should I use for my game? It's a 2d game in zelda like style, I intend to use either alpha channels or color keying in the textures and heard about TGA, DXT etc. So what format would be the best for me to use? I'd also appreciate if you know any websites with tutorials on how to use that texture format By the way, I'm using SDL+OpenGL. Thanks in advance, Victor Freire
psycho_svk
psycho_svk
png files have alpha values..
you can load them with glpng library [see link for more]

this library is very easy to use - here is the simplest example:
pngInfo info;GLuint id = pngBind("Texture.png", PNG_NOMIPMAP, PNG_SOLID, &info, GL_CLAMP, GL_NEAREST, GL_NEAREST);if (id != 0){   puts("Loaded Texture.png with resounding success");   printf("Size=%i,%i Depth=%i Alpha=%i\n", info.Width, info.Height, info.Depth, info.Alpha);}else{   puts("Can't load Texture.png");   exit(1);}

and then just glBindTexture(GL_TEXTURE_2D, id);
Alpha Nox
Alpha Nox
Ok, I just downloaded and I'm going to try it, it seems really simple to use indeed.

Thanks a lot for the quick answer!


Promit
Promit
I'd say, download the DevIL image library, and don't worry about your formats. Later on you may want to favor certain formats due to compression or speed benefits, but at this stage it really doesn't matter.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.