PDA

View Full Version : texture loading source needed


Grand_1
21-Jul-2003, 22:03
what are the bare nessities for loading a bmp/texture?

Xmas
21-Jul-2003, 23:00
First of all, you need a computer...
That's a strange question. You need a programming language that allows you to open files in binary mode. And then you need to know the structure of a BMP file, which is very simple an can be found all over the web.

Grand_1
22-Jul-2003, 19:13
no REALLY, I need a COMPUTER!!! hmm, hey mr.dinglefriz WHAT ABOUT A
KEYBOARD OR A MONITOR!

well anyway, for all you inteligent people out there, ill rephrase.
how do you load a bmp file, with borland c++, in openGL.


Their Xmas happy?

Myrmecophagavir
22-Jul-2003, 19:46
Now now, no need to be like that. Your initial question was indeed far too vague for anyone to help. Now that we have more info, like what language and API you're using, it's going to help a lot more.

In fact Xmas happens to have told you exactly what you need. OpenGL has no built-in load-texture-from-file function, unlike Direct3D. So you need to do exactly as he says: find out the file format of a .bmp file from the web, load that into memory as you would any other file, then use an OpenGL function such as gluBuild2DMipmaps(). Then you need to tell OpenGL to use texturing...

arjan de lumens
22-Jul-2003, 21:16
Loading a BMP as a texture map in OpenGL is pretty much what NeHe's (http://nehe.gamedev.net/) tutorial #6 (http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=06) is about - check it out. Just make sure that before you try to load the BMP, that the BMP you want to use has width and height that are powers of 2 (typically 64, 128, 256), or else OpenGL won't accept it as a texture map.