6 let w = GWindow.window ~title:"LablGL/Gtk" () in
7 w#connect#destroy ~callback:Main.quit;
9 GlGtk.area [`RGBA;`DEPTH_SIZE 1] ~width:500 ~height:500 ~packing:w#add () in
10 area#connect#realize ~callback:
12 GlMat.mode `projection;
13 GlMat.load_identity ();
14 GlMat.ortho ~x:(-1.0,1.0) ~y:(-1.0,1.0) ~z:(-1.0,1.0);
16 area#connect#display ~callback:
18 GlClear.color (0.0, 0.0, 0.0);
19 GlClear.clear [`color];
20 GlDraw.color (1.0, 1.0, 1.0);
21 GlDraw.begins `polygon;
22 GlDraw.vertex ~x:(-0.5) ~y:(-0.5) ();
23 GlDraw.vertex ~x:(-0.5) ~y:(0.5) ();
24 GlDraw.vertex ~x:(0.5) ~y:(0.5) ();
25 GlDraw.vertex ~x:(0.5) ~y:(-0.5) ();
29 Timeout.add ~ms:10000 ~callback:(fun () -> w#destroy ();false);