I first enable texturing , set the actual texture , and draw the triangle with textures , then I disabled texturing and the use of textured objects and I draw the second triangle. But this doesnt work! When I do this ALL the scene is painted as the last color of the second triangle! Evererything turns blue! Please can anyone enlight-me of whats going on and how to solve this?
If the complete scene is blue, you are too near to the last triangle. It seems to fill the whole view.
If it’s only drawn in blue and not Gouraud shaded red/green/blue, than you have flat shading enabled. Look for glShadeModel(GL_FLAT). Flat shading always takes the last color of each (sub-)primitive, except for polygons where it’s the first color.
OpenGL default is glShadeModel(GL_SMOOTH).
First of all in your code after you have textured the first triangle you then do another glBind(…) which isn’t needed.
Secondly, are your triangles on top of each other-this wouldn’t work. Also if the second untextured triangle is much nearer than the textured then this will hide the textured triangle and may also fill the whole screen. Try changeing the last color of the second untextured triangle and see if the screen colour changes apropriately.
Also try each triangle seperately and see if each work by their selfs.
Hope this works