Whats wrong with my code? :(

Hi I was trying to render objects with textures and without in the same scene and the code I wrote came something like

(imagine that I already initialized everything and read the textures,and named(glGentextures) then and defined then(glTexImage2D))

void draw()
//first draw the textured triangle
//then draw the colored triangle



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?

-My hat!

OpenGL is drawing your textured triangle and if you can not see it do you draw something above it or so is it not in the viewing cone.

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