Invalid Operation on glDrawArrays non triangles

I have been bashing my head against this for a while now, and need some help.

I’m getting an invalid operation (1282) when I try to draw using anything but a triangle-based primitive type (GL_TRIANGLES, GL_TRIANGLE_STRIP and GL_TRIANGLE_FAN). I haven’t been able to reproduce the problem with simpler test cases, and unfortunately cannot share the code, so what I’m really asking here is if anyone knows of any way in which drawing with (for example) GL_LINES or GL_QUADS can differ to drawing with GL_TRIANGLES, other than supplying a different parameter to glDrawArrays/Elements. Is there some other step or change that I could be missing?

For reference, I’m drawing via an FBO which is bound through a VAO, and with a shader program which has a vertex and fragment shader linked. I’m not using any of the deprecated fixed function API.


GL_QUADS aren’t core any more. GL_LINES means the vertices are in pairs so I would check your parameters. In principle the function calls are the same. It is a bit hard to help without some code to look at.