I have an OpenGL-related issue. Whenever I attempt to draw a simple polygon using four vertices from a vertex buffer… nothing happens. However, it will draw the shape in GL_TRIANGLES or GL_TRIANGLE_STRIP mode, albeit distorted. Am I doing something wrong?
Relevent code:
Vertex array: https://i.stack.imgur.com/4ybC6.png
GL_POLYGON: https://i.stack.imgur.com/cUEJR.png
GL_TRIANGLES: https://i.stack.imgur.com/3imiW.png
GL_TRIANGLE_STRIP: https://i.stack.imgur.com/N9Qfu.png
First of all, never use a “forward-compatible core profile”. You should just use a core profile; stop using the forward compatibility bit. It’s pointless.
More importantly,
GL_POLYGONis not part of a core OpenGL profile. It was removed in 3.1. So your code is likely giving you aGL_INVALID_ENUMerror that you’re ignoring.Lastly, always post your OpenGL version and profile in your question.