Skip to content

Instantly share code, notes, and snippets.

@WillForan
Created April 18, 2022 00:46
Show Gist options
  • Save WillForan/0e4b4f8f4c8d103e780e0438aa25bbd9 to your computer and use it in GitHub Desktop.
Save WillForan/0e4b4f8f4c8d103e780e0438aa25bbd9 to your computer and use it in GitHub Desktop.
teapot: teapot.cc
g++ -o teapot teapot.cc -lGL -lGLU -lglut
// helloteapot.cc
#include <GL/gl.h>
#include <GL/glut.h>
void display () {
/* clear window */
glClear(GL_COLOR_BUFFER_BIT);
/* draw scene */
//glutSolidTeapot(.5);
glutWireTeapot(1);
/* flush drawing routines to the window */
glFlush();
}
int main ( int argc, char * argv[] ) {
/* initialize GLUT, using any commandline parameters passed to the
program */
glutInit(&argc,argv);
/* setup the size, position, and display mode for new windows */
glutInitWindowSize(500,500);
glutInitWindowPosition(0,0);
glutInitDisplayMode(GLUT_RGB);
/* create and set up a window */
glutCreateWindow("hello, teapot!");
glutDisplayFunc(display);
/* tell GLUT to wait for events */
glutMainLoop();
}
#!/usr/bin/env perl
use OpenGL::GLUT ':all';
glutInit; my $Window_ID = glutCreateWindow("wtitle");
#glutSolidTeapot(1);
glutWireTeapot(1);
glutSwapBuffers();
sleep 10;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment