Jump to content
  • Advertisement
Sign in to follow this  
dxben

OpenGL glBegin(GL_QUADS) keeps failing

This topic is 4884 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
        cgGLBindProgram(_fragmentProgram);
        cgGLEnableProfile(g_cgProfile);
            
        // bind the scene texture as input to the filter
        cgGLSetTextureParameter(_textureParam, _iTexture);
        cgGLEnableTextureParameter(_textureParam);
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
Advertisement
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?

Cheers
-Danu

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!