Created
March 19, 2010 15:00
-
-
Save baris/337573 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* ocamlopt -I +glMLite GL.cmxa Glut.cmxa testgl.ml *) | |
open GL;; | |
open Glu;; | |
open Glut;; | |
let start_show () = | |
glClear [GL_COLOR_BUFFER_BIT]; | |
glBegin GL_TRIANGLES; | |
glColor4 1.0 1.0 0.0 0.75; | |
glLoadIdentity (); | |
glMatrixMode GL_MODELVIEW; | |
glVertex3 (Random.float 1.0) (Random.float 1.0) (Random.float 1.0); | |
glVertex3 (Random.float 1.0) (Random.float 1.0) (Random.float 1.0); | |
glVertex3 (Random.float 1.0) (Random.float 1.0) (Random.float 1.0); | |
glEnd (); | |
glutSwapBuffers(); | |
;; | |
let () = | |
ignore(glutInit Sys.argv); | |
glutInitDisplayMode [GLUT_DOUBLE]; | |
ignore(glutCreateWindow Sys.argv.(0)); | |
glutDisplayFunc ~display:start_show; | |
glutIdleFunc ~idle:(glutPostRedisplay); | |
glutMainLoop(); | |
;; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment