How do I make this simple OpenGL code (works in a “lenient” 3.3 and 4.2 profile) work in a strict 3.2 and 4.2 core profile?
问题 I had some 3D code that I noticed wouldn't render in a strict core profile but fine in a "normal" (not explicitly requested-as-core-only) profile context. To isolate the issue, I have written the smallest simplest possible OpenGL program drawing just a triangle and a rectangle: I have posted that OpenGL program as a Gist here. With the useStrictCoreProfile variable set to false, the program outputs no error messages to the console and draws a quad and a triangle as per the above screenshot,