View Full Version : Textures, again. Am i being dense?

01-05-2005, 08:29 AM
Hello there!

Ive started using OpenGL with VisualStudio .NET 2003, and have been trying for days to get textures to work. Ive looked at the Red Book and the NeHe tutorials, but still no joy. Is there a way of using textures without having to go through windows programming and would it be possible to have a step by step? anything to prevent me from going crazy!

thank you,


01-05-2005, 01:06 PM
Easy, use glut, it is cross platform and the simplest way to create a small gl app.

Example code for texture :

Glut download :

About nehe, note that for most lesson there is glut code available, listed at the bottom of the page.
Ie, for lesson 1 :

01-05-2005, 01:35 PM
cheers for that, but that is creating the texture in the program, i would like to import a texture.

i understand that it involves other function calls, but do they have to be done using windows libraries?

01-05-2005, 02:17 PM
A ok, so it is not an opengl problem :)

Either you use a image loading library, or you write yours. Uncompressed TGAs are quite simple, RAW format is even simpler, you just read bytes.

Quite complete lib, no need to reinvent the wheel : DevIL (http://openil.sourceforge.net/) , corona (http://corona.sourceforge.net/) , or the libjpeg, libpng, etc

Prefer to do it yourself ? wotsit (http://www.wotsit.org/search.asp?s=graphics)