Try calling the following before your rendering loop:
This is a really bad advice. See this: Nvidia: Deprecation Myths. Of course everything pre-GL3 is considered legacy now, but it doesn't mean you can't use it for learning. Newer APIs such as Metal/Vulkan/Direct3D 12 are notoriously difficult to get started, so if you want to get something working quickly, glBegin/glEnd is as good as any other option, and in regards in performance, it is likely faster than the source code you suggested (and I challenge you to prove different: do the benchmarks!)glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
I would suggest to use whatever technique you find easier to learn - it is better to have something working in the way you want, than not having anything at all.
Bookmarks