From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 998DABC69 for ; Thu, 12 Apr 2007 22:26:45 +0200 (CEST) Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l3CKQiqD028001 for ; Thu, 12 Apr 2007 22:26:45 +0200 Received: from compute2.internal (compute2.internal [10.202.2.42]) by out1.messagingengine.com (Postfix) with ESMTP id 7BCC12153DD; Thu, 12 Apr 2007 16:26:49 -0400 (EDT) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute2.internal (MEProxy); Thu, 12 Apr 2007 16:26:45 -0400 X-Sasl-enc: dEzGy8NjoFtNXFWlCjnZVRtgiTRCDXMQM3UdgS5qtgM6 1176409605 Received: from munge.ljcrf.edu (burnham.ljcrf.edu [192.231.106.2]) by mail.messagingengine.com (Postfix) with ESMTP id D105E29335; Thu, 12 Apr 2007 16:26:44 -0400 (EDT) Date: Thu, 12 Apr 2007 13:26:36 -0700 (PDT) From: Martin Jambon X-X-Sender: martin@localhost To: Jon Harrop Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Example slowing down... (OpenGL/lablgl) In-Reply-To: <200704122046.18632.jon@ffconsultancy.com> Message-ID: References: <20070411222521.GA1603@first.in-berlin.de> <200704120815.24433.jon@ffconsultancy.com> <20070412143329.GB396@first.in-berlin.de> <200704122046.18632.jon@ffconsultancy.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Miltered: at concorde with ID 461E9604.004 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ens-lyon:01 lablgl:01 bandel:01 ocaml:01 wikipedia:01 argv:01 buffer:01 triangles:01 iter:01 mainloop:01 2007,:98 presenta:98 10.:98 wrote:01 wrote:01 On Thu, 12 Apr 2007, Jon Harrop wrote: > On Thursday 12 April 2007 15:33, Oliver Bandel wrote: > > > http://www.ffconsultancy.com/products/ocaml_for_scientists/visualisation/ > > > > There I get an error messaage that glutCreateWindow is called before > > glutInit. > > Ugh, sorry. They changed freeglut to be more pedantic (which might actually > fix some crashing issues I had with Presenta). You need to call glut.init as > the Wikipedia example does. > > > I have not looked at the examle in detail, > > but if it's not an OCaml-problem then that's fine. > > Well, I think it is probably just the choice of "time" function. Try it to > make sure though. No, it seems to be related to the matrix accumulating numerical errors. The following works just fine: let _ = ignore( Glut.init Sys.argv ); Glut.initDisplayMode ~double_buffer:true (); ignore (Glut.createWindow ~title:"OpenGL Demo"); let angle t = 10. *. t *. t in let render () = GlClear.clear [ `color ]; GlMat.load_identity (); GlMat.rotate ~angle: (angle (Sys.time ())) ~z:1. (); GlDraw.begins `triangles; List.iter GlDraw.vertex2 [-1., -1.; 0., 1.; 1., -1.]; GlDraw.ends (); Glut.swapBuffers () in GlMat.mode `modelview; Glut.displayFunc ~cb:render; Glut.idleFunc ~cb:(Some Glut.postRedisplay); Glut.mainLoop () -- Martin Jambon http://martin.jambon.free.fr