Title says it all, really. I am initializing my OpenGL context and in the middle of setting up stuff like glPolygonMode(GL_FRONT_AND_BACK, GL_FILL), glEnable(GL_DEPTH_TEST), etc. when I make a call to glEnable(GL_TEXTURE_2D) I get the following ENUM error: “GL_INVALID_ENUM”
It sounds as if you have an OpenGL 3+ core profile context, where GL_TEXTURE_2D is indeed not a valid argument to glEnable() (it’s only meaningful for the fixed-function pipeline, and OpenGL 3+ core profile doesn’t support the fixed-function pipeline).
glEnable(GL_TEXTURE_2D) instructs the fixed-function pipeline’s equivalent of the fragment shader to use textures to determine the fragment colour, in accordance with the glTexEnv() settings. If disabled, the fragment colour is based upon vertex colours or the current colour, without involving textures.
It doesn’t affect anything else, so when a fragment shader is being used it doesn’t affect anything.
glEnable(GL_TEXTURE_2D) instructs the fixed-function pipeline’s equivalent of the fragment shader to use textures to determine the fragment colour, in accordance with the glTexEnv() settings. If disabled, the fragment colour is based upon vertex colours or the current colour, without involving textures.
It doesn’t affect anything else, so when a fragment shader is being used it doesn’t affect anything.[/QUOTE]
Thanks! Removing this line was indeed OK. I have another issue but that’ll be in a separate post.