Advertisement Jump to content
Sign in to follow this  

OpenGL glBegin(GL_QUADS) keeps failing

This topic is 4983 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Whenever I have the following prior to calling glBegin, my call to glBegin returns invalid operation:
        // run the edge detection filter over the geometry texture
        // Activate the edge detection filter program
        // bind the scene texture as input to the filter
        cgGLSetTextureParameter(_textureParam, _iTexture);
If I remove these lines, glBegin() works, but obviously my shader doesn't run. Strange thing is that this works in another project of mine that uses opengl, but the whole app is setup differently and I have no idea why its not working in my 2nd app. Any ideas? textureparam and the shader and profile are all properly setup. Cg is not returning any errors, it just seems its doing something bad to the opengl state.

Share this post

Link to post
Share on other sites
do you have a valid CG and GL context?
call cgGetError() to be sure of no silent internal errors and make sure
you call glGetError() directly before and directly after glBegin to make sure
that it is infact returning the error, and not a cumilative error from
elsewhere in the call history.

providing some code would help, maybe the block around glBegin?


Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!