Does anyone know of a good way to load a bmp to a texture in OpenGl besides the one on NeHe, it is buggy and doesn't work on most bmps. I know of the SDL_LoadBMP, but I don't want to use SDL yet. I don't think glut has one.
Does anyone know of a good way to load a bmp to a texture in OpenGl besides the one on NeHe, it is buggy and doesn't work on most bmps. I know of the SDL_LoadBMP, but I don't want to use SDL yet. I don't think glut has one.
There are several several ways to do this, as there are several several libraries for doing this. I myself used PNG files and used http://linux.tucows.com/preview/47311.html to load them. glpng is the easiest way to do this IMHO, but of course you have to use PNG, which is generally A Good Thing (TM). If you are hellbent on using bmp files, then you could download the specification off of Wotsit's File Format library and write some code yourself. You could also find a way to convert a HBITMAP into a OpenGL texture. You could also use DevIL, which is a very nice library.
Another route you could take is to use google. Never hurts
if you want some code that you can build off of, I have so far programmed up the loading of both BMP and TARGA(both RLE and RAW) files from scratch and can give you the code probably later today or tommorrow if you want.
there used to be something here, but not anymore
I would like to use glpng, but I can't seem to get it working. I used the makefile to build the .o file. I put it in my /usr/X11R6/lib then used -L/usr/X11R6, but no avail. What did you do bludstayne?
Loading the BMP is easy. Then you simply need to place the bmp onto the texture surface for GL...but I don't do GL so I'm not sure what you need to do.
Try looking in wotsit.com, on the first page of the 'windows' area.
I knew all this. I just wanted to know if there was a good one written; right now I am not really interested in loading textures, but writing a simple game. I just want to get this freaking glpng thing working.
he is reffering to the actual loading of the data from the file which has to be done before you can create a texture out of the bytes of data.Loading the BMP is easy. Then you simply need to place the bmp onto the texture surface for GL...but I don't do GL so I'm not sure what you need to do
there used to be something here, but not anymore
is it a .o or a .so ( or even a .a) If it is a library you'll need someting like "-lglpng" to link it. are you getting compiler errors or runtime errors? more info needed....Originally Posted by linuxdude
d with the -lglpng. I had to put libglpng.a to my /usr/X11R6/lib directory also thanx.