PDA

View Full Version : help with loading bitmaps



jono_123
04-01-2002, 06:40 PM
hi there
im having troubles loading bitmaps
i've got the code from nehe and it does a bit like this:

#include <GL/glaux.h>

AUX_RGBImageRec *Image = NULL;
Image=auxDIBImageLoad("somebitmapfile");

where in place of somebitmapfile i put a path of a bitmap e.g c:\windows\Circles.bmp
but i keep getting the error :
undefined reference to `auxDIBImageLoadA@4'

can someone help me out?
thanks

Elixer
04-01-2002, 06:49 PM
That is a linker error is it not?

Also, don't use aux... Nehe has a better .bmp reader in one of the tutorials.

nexusone
04-01-2002, 06:50 PM
Did you put in your linker, to include the glaux.lib?

The glaux.lib is only used for BMP file loading. Later in nehe tutors, you will find he stop's using the glaux libray.
And starts useing a TGA file loader for his textures, since the glaux library is no longer supported.
TGA has advantages over BMP files, one is that it is easier to load the files and it supports a alpha channel(which is very useful).


Originally posted by jono_123:
hi there
im having troubles loading bitmaps
i've got the code from nehe and it does a bit like this:

#include <GL/glaux.h>

AUX_RGBImageRec *Image = NULL;
Image=auxDIBImageLoad("somebitmapfile");

where in place of somebitmapfile i put a path of a bitmap e.g c:\windows\Circles.bmp
but i keep getting the error :
undefined reference to `auxDIBImageLoadA@4'

can someone help me out?
thanks

jono_123
04-01-2002, 07:01 PM
so how do i load a bitmap without glaux?

nexusone
04-01-2002, 07:06 PM
There are other routines you can use to do this, other people have writen code to load BMP's. (See the nehe site, tutor 33 has a TGA loader and I think there is also BMP loader)
And as I suggested you can use the TGA format, any good paint program can convert BMP to TGA.



Originally posted by jono_123:
so how do i load a bitmap without glaux?

coredump
04-02-2002, 04:08 AM
windows has it's own native code for loading .BMPs. if you have visual studio, the documentation outlines all you need to know.

b

J P
04-02-2002, 06:13 AM
See examples 1-4 on how to load load bitmaps without glaux.
http://www.mfcogl.com/bitmaps.%20MFC%20&%20OpenGL.htm