Skip to content

Instantly share code, notes, and snippets.

@borja-munoz
Created November 13, 2021 15:17
Show Gist options
  • Save borja-munoz/a457fcf6a6fe4d07139db1c59da640fb to your computer and use it in GitHub Desktop.
Save borja-munoz/a457fcf6a6fe4d07139db1c59da640fb to your computer and use it in GitHub Desktop.
Hello World - OpenGL Programming Guide
#include <whateverYouNeed.h>
main() {
InitializeAWindowPlease();
glClearColor (0.0, 0.0, 0.0, 0.0);
glClear (GL_COLOR_BUFFER_BIT);
glColor3f (1.0, 1.0, 1.0);
glOrtho(0.0, 1.0, 0.0, 1.0, -1.0, 1.0);
glBegin(GL_POLYGON);
glVertex3f (0.25, 0.25, 0.0);
glVertex3f (0.75, 0.25, 0.0);
glVertex3f (0.75, 0.75, 0.0);
glVertex3f (0.25, 0.75, 0.0);
glEnd();
glFlush();
UpdateTheWindowAndCheckForEvents();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment