PDA

View Full Version : Texture Problem



11-05-2002, 08:18 AM
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?

nexusone
11-05-2002, 08:26 AM
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?

B_old
11-05-2002, 08:27 AM
Hello.



glEnable(GL_TEXTURE_2D);

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

11-05-2002, 09:42 AM
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