should be:
glGenTextures(1,texturename);
or:
glGenTextures(1,&texturename[0]);
because you use the [0]th element of the array, so get a valid textureobj for it, and not for the next element in the array …
sorry, cant see any other errors, maybe the bmp is not loaded, or the dimensions of the texture are not n^2, or you call the binds between glBegin(); glEnd(); …
try to use a 1d texture, and use as data some array like:
data[8]= { 0, 1, and so on
when it work, your bmp isnt loaded correct or in the correct dimensions
Send the app and texture to me (e-mail in profile, remove “nospam”) if you like and I’ll have a look on Sunday Australian time (day after tomorrow). It could be a number of things.
I tried to e-mail the code to you but it didn’t work so here are my changes:
(i) You must put your init() function after all the GLUT initialisation code, in the line after glutCreateWindow. This is why the texture wasn’t being bound properly.
(ii) The depth testing you are doing is making other problems with the display. Comment out the two lines in your init() function that enable depth testing and the depth func to use.
(iii) There are other problems with the program but making those two changes will get you started. If you have any other questions post them and someone will be glad to help.
E-mail me if you need any more help with this program or you don’t understand my explanations.
Thanks It works :-)but I get now problem with rotating the yellow part of texture disappears when I rotate cube . It’s a problem with graphics card or something else (like VC++ 6.0 … )I’m using CL 5446 as primary graphics card( crapy but I’ll try Voodoo 2 (crapy too - but still works) later