Skip to content
Snippets Groups Projects
Select Git revision
  • 09796c457a99a905faab8e1394d2ca4c4fd81989
  • main default protected
  • latest
3 results

bash.log

Blame
  • hello-opengl.c 712 B
    #include <GL/gl.h>
    #include <GL/glu.h>
    #include <GL/glut.h>
    
    void draw (void)
    {
      glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
      glColor3f (1.0, 1.0, 0.0);
      glRasterPos2f (-0.65, -0.1);
      char *hello = "Hello, world!";
      while (*hello)
        glutBitmapCharacter (GLUT_BITMAP_HELVETICA_18, *hello++);
      glFlush ();
      glutSwapBuffers ();
    }
    
    void timer_handler (int data)
    {
      exit (0);
    }
    
    int main (int argc, char **argv)
    {
      glutInit (&argc, argv);
      glutInitDisplayMode (GLUT_RGBA | GLUT_DOUBLE | GLUT_DEPTH);
      glutInitWindowSize (320, 200);
      glutCreateWindow ("Hello");
      glutDisplayFunc (draw);
      glutTimerFunc (5000, timer_handler, 0);
      glutMainLoop ();
      return 0;
    }