Opengl 2 — |best|
glMatrixMode(GL_MODELVIEW); glLoadIdentity(); gluLookAt(0, 2, 5, 0, 0, 0, 0, 1, 0);
glBegin(GL_TRIANGLES); glColor3f(1,0,0); glVertex3f(-1,-1,0); glColor3f(0,1,0); glVertex3f( 1,-1,0); glColor3f(0,0,1); glVertex3f( 0, 1,0); glEnd();
Here’s a minimal working example in C (GLUT/FreeGLUT): opengl 2
int main(int argc, char** argv) glutInit(&argc, argv); glutInitDisplayMode(GLUT_DOUBLE
Anyone else still occasionally writing fixed-function OpenGL for fun? 😄 But in practice, most people associate "OpenGL 2"
#include <GL/glut.h> void display() GL_DEPTH_BUFFER_BIT);
I’ve been messing around with OpenGL 2.1 lately (I know, I know, it’s ancient), mostly for some retro demo coding and to understand the basics before moving to modern programmable pipelines. But in practice
For those who didn't start there, OpenGL 2 introduced the shader model (1.10/1.20) and still fully supported the fixed-function pipeline. But in practice, most people associate "OpenGL 2" with immediate mode ( glBegin/glEnd ), glVertex , glMatrixMode , and lighting via glLight .