After installing the OpenGL libraries on your system, you would definitely want to display something on the screen.
You are right!
So let’s see this with an Hello World! OpenGL 2.1 tutorial.
This is really a basic code to display a window and saying: “Great I can do it”.
Such basic that it seems C implementation (indeed we don’t have any class in this example).
Code // badprog.com #include void displayMe(void) { glClear(GL_COLOR_BUFFER_BIT); glBegin(GL_POLYGON); glVertex3f(0.0, 0.0, 0.0); glVertex3f(0.5, 0.0, 0.0); glVertex3f(0.5, 0.5, 0.0); glVertex3f(0.0, 0.5, 0.0); glEnd(); glFlush(); } int main(int argc, char** argv) { glutInit(&argc, argv); glutInitDisplayMode(GLUT_SINGLE); glutInitWindowSize(300, 300); glutInitWindowPosition(100, 100); glutCreateWindow("Hello world from Badprog.com :D"); glutDisplayFunc(displayMe); glutMainLoop(); return 0; } Compiling g++ main.cpp -o lookAtThis -lglut ; ./lookAtThis Result A black window with a white square displayed.
...