OpenGL in Linux ,program for A to Z

very simple program

#include <whateverYouNeed.h>

main() {

OpenAWindowPlease();

glClearColor(0.0, 0.0, 0.0, 0.0);
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1.0, 1.0, 1.0);
glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0);
glBegin(GL_POLYGON);
glVertex2f(-0.5, -0.5);
glVertex2f(-0.5, 0.5);
glVertex2f(0.5, 0.5);
glVertex2f(0.5, -0.5);
glEnd();
glFlush();

KeepTheWindowOnTheScreenForAWhile();
}

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.