PDA

View Full Version : someone please help



jono_123
04-26-2002, 03:31 PM
ive been looking all over the net on how to load a bitmap image file and turn it into a texture
ive read most of the tutorials at nehe with no luck
ive tryed the glaux.h and that doesnt work
could someone please help me out here?

ThinIce
04-26-2002, 05:35 PM
Whaaat? You've read the tutorials and can't grasp it ?

I'd reccomend you go back and slowly go over some of the tutorials... Especailly the one that is specifically focused on Loading a bitmap. It isn't that rigorus of a task...

nexusone
04-26-2002, 06:00 PM
What kind of error are you getting when you try to load a texture?
What format is the texture in?

Is the texture size a power of 2?

2x2, 4x4, 32x32, 64x64, 64x32, etc?

Don't use glaux, it is out dated?



Originally posted by jono_123:
ive been looking all over the net on how to load a bitmap image file and turn it into a texture
ive read most of the tutorials at nehe with no luck
ive tryed the glaux.h and that doesnt work
could someone please help me out here?

Miguel_dup1
04-26-2002, 07:17 PM
Do you have any ideas as of how to do it... Or you have to be told from the very beginning...?

What is it exactly what you having problems with? Can you load the texture file?

04-27-2002, 11:20 AM
I started off with getting to know the bmp file format. Wrote a 24bit bmp loader and then started looking for other fileformats with differnet properties.

Get to know your fileformat. BMP files:
http://www.wotsit.org/download.asp?f=bmpfrmat

Useful data structures can be found at the msdn.microsoft.com site too.

/Peter

jmathies
04-27-2002, 02:29 PM
Originally posted by jono_123:
ive been looking all over the net on how to load a bitmap image file and turn it into a texture
ive read most of the tutorials at nehe with no luck
ive tryed the glaux.h and that doesnt work
could someone please help me out here?
http://www.mathies.com/cpw/srctohtml/cpw_bitmaps.c.html

Here's a good example. Hope it helps. The code from this lib is free, so feel free to pull this function out for use in your own program.

Regards,
Jim

jono_123
04-27-2002, 06:02 PM
which tutorial at nehe shold i be reading??i might have missed one. the bitmap is a power of 2 but my problem is that it wont even load

nexusone
04-28-2002, 11:03 AM
You still have not answered our questions?
You need to give more detail's other then it will not load!!!.

1. Do you get an error?
2. what is the file format you are trying to load?
3. what does the object that suppost to have the texture look like?
4. The tutorial 6 on nehe is the one on loading bitmaps textures!


Originally posted by jono_123:
which tutorial at nehe shold i be reading??i might have missed one. the bitmap is a power of 2 but my problem is that it wont even load

jono_123
04-29-2002, 07:57 PM
well if you had read what i posted u would have found 2. .bmp 3. a cube 4. nehe uses glaux which gives an error like auxDIBLoadImage@4 or sumthin like that!!!
1. i dont get any errors cuz i havnt tryed anything so now i am asking: HOW do you go about loading a .bmp image file for my hard drive and loading it onto a square which will eventually be but on a cube. also i do not want to use glaux and i have read most of nehe's tutorials but if i have missed some,would someone please tell me which number tutorial

some one please please please help me with this one!!!


Originally posted by nexusone:
You still have not answered our questions?
You need to give more detail's other then it will not load!!!.

1. Do you get an error?
2. what is the file format you are trying to load?
3. what does the object that suppost to have the texture look like?
4. The tutorial 6 on nehe is the one on loading bitmaps textures!

Deiussum
04-30-2002, 04:37 AM
That error you said you get when using glAux sounds like a linker error. You need to go too project->settings->link->Object/Library modules, and add glaux.lib. For future reference, there are a few different types of errors. Compiler errors, linker errors, and runtime errors. If you had given the error right away, we would have identified it as a linker error. Compiler and linker errors both occur when you try to build the executable, but at different stages. Runtime errors occur AFTER you've built the executable and try to run it.

If you still don't want to use glaux (which is no longer being worked on, btw.) Your other option is to find some other image loading library (like SDL), or write your own BMP loading code. If you write your own BMP code, you can find info on the BMP format at www.wotsit.org. (http://www.wotsit.org.)

[This message has been edited by Deiussum (edited 04-30-2002).]

nexusone
04-30-2002, 04:47 AM
1. Maybe you need to read your own post! You only said your loading a bitmap image...most graphics images are in bitmaped format (BMP, GIF, TGA,etc) http://www.opengl.org/discussion_boards/ubb/tongue.gif
For all I know you where trying to load a gif as a BMP!!! with glaux.

2. You never said that you yes or no to getting an error.

3. On the nehe lesson 6, is on loading an BMP image on to a cube! If you don't want to use glaux, then maybe you want to instead of using the BMP format, use TGA format for you images. nehe on lesson 33, has a nice TGA file loader routine. The routine loads the file into a texture.


Originally posted by jono_123:
well if you had read what i posted u would have found 2. .bmp 3. a cube 4. nehe uses glaux which gives an error like auxDIBLoadImage@4 or sumthin like that!!!
1. i dont get any errors cuz i havnt tryed anything so now i am asking: HOW do you go about loading a .bmp image file for my hard drive and loading it onto a square which will eventually be but on a cube. also i do not want to use glaux and i have read most of nehe's tutorials but if i have missed some,would someone please tell me which number tutorial

some one please please please help me with this one!!!



[This message has been edited by nexusone (edited 04-30-2002).]

[This message has been edited by nexusone (edited 04-30-2002).]

[This message has been edited by nexusone (edited 04-30-2002).]

jono_123
04-30-2002, 10:05 PM
ok thanx for that that answered a few questions but my editor doesnt have project->settings->link->Object/Library modules
so what should i do?????


Originally posted by Deiussum:
That error you said you get when using glAux sounds like a linker error. You need to go too project->settings->link->Object/Library modules, and add glaux.lib. For future reference, there are a few different types of errors. Compiler errors, linker errors, and runtime errors. If you had given the error right away, we would have identified it as a linker error. Compiler and linker errors both occur when you try to build the executable, but at different stages. Runtime errors occur AFTER you've built the executable and try to run it.

If you still don't want to use glaux (which is no longer being worked on, btw.) Your other option is to find some other image loading library (like SDL), or write your own BMP loading code. If you write your own BMP code, you can find info on the BMP format at www.wotsit.org. (http://www.wotsit.org.)

[This message has been edited by Deiussum (edited 04-30-2002).]

coredump
05-01-2002, 03:38 AM
...but my editor doesnt have project->settings->link->Object/Library modules so what should i do?????

are you using VC++? this is how to add the gl libs in VC++. if you are using some other package the process for adding libraries will be different. maybe you should tell us the exact error message. cut'n'paste.

b

nexusone
05-01-2002, 03:59 AM
Try READING THE INSTRUCTIONS for your compiler!!!
Find the linker settings, and add glaux.lib!
Which are normaly under compiler settings.

http://www.opengl.org/discussion_boards/ubb/smile.gif


Originally posted by jono_123:
ok thanx for that that answered a few questions but my editor doesnt have project->settings->link->Object/Library modules
so what should i do?????

Deiussum
05-01-2002, 04:37 AM
Sorry, I should have specified that that was how you add libraries in VC++. Anyway, if you are using Borland, you might be out of luck. Borland appears to come with glaux.h, but no glaux.lib. (At least the free 5.5 compiler doesn't.) And since glaux.lib is a satic library, there is no DLL that you can use to create a Borland compatible .lib from using implib. You may be able to find a Borland compatible library for glaux online somewhere, but you'd probably be better off using SDL, or reading the BMP in yourself. (jmathies gave you code for doing that above, in case you missed it).