Texture Problem

I write a VC++ program to load a color BMP file to a rectangle but when i run it all the rectangles are in black and gray color. So what wrong?

Do you have lighting turned on?
If lighting is turned on is also Color matrial?

example:

glEnable(GL_LIGHTING);
glEnable(GL_COLOR_MATERIAL);

Originally posted by Gilbee:
I write a VC++ program to load a color BMP file to a rectangle but when i run it all the rectangles are in black and gray color. So what wrong?

Hello.

glEnable(GL_TEXTURE_2D);

Maybe you forgot this?
You could always show us your code, though.
We might help you better then.

hi
sigh~~
I made a mistake when using gluBuild2DMipmaps

eg
gluBuild2DMipmaps(target, components, width, height,format,type, data )

I set the components to 1 so it only disply black color…
now my program can work~
Thx