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=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id CD438BC69 for ; Thu, 12 Apr 2007 00:25:24 +0200 (CEST) Received: from einhorn.in-berlin.de (einhorn.in-berlin.de [192.109.42.8]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l3BMPNwn004550 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Thu, 12 Apr 2007 00:25:24 +0200 X-Envelope-From: oliver@first.in-berlin.de X-Envelope-To: Received: from first (dslb-088-073-108-005.pools.arcor-ip.net [88.73.108.5]) (authenticated bits=0) by einhorn.in-berlin.de (8.13.6/8.13.6/Debian-1) with ESMTP id l3BMPNoY007853 for ; Thu, 12 Apr 2007 00:25:23 +0200 Received: by first (Postfix, from userid 501) id 9A22C3A68CB; Thu, 12 Apr 2007 00:25:21 +0200 (CEST) Date: Thu, 12 Apr 2007 00:25:21 +0200 From: Oliver Bandel To: caml-list@inria.fr Subject: Example slowing down... (OpenGL/lablgl) Message-ID: <20070411222521.GA1603@first.in-berlin.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6i X-Scanned-By: MIMEDefang_at_IN-Berlin_e.V. on 192.109.42.8 X-Miltered: at discorde with ID 461D6054.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; bandel:01 in-berlin:01 lablgl:01 lablgl:01 wikipedia:01 wiki:01 ocaml:01 argv:01 buffer:01 triangles:01 iter:01 mainloop:01 ocaml:01 ocaml-code:01 bandel:01 Hello, today I tried lablgl the first time succesful. :) It's nice. I tried the example from http://en.wikipedia.org/wiki/OCaml ================================================================= let _ = ignore( Glut.init Sys.argv ); Glut.initDisplayMode ~double_buffer:true (); ignore (Glut.createWindow ~title:"OpenGL Demo"); let render () = GlClear.clear [ `color ]; GlMat.rotate ~angle:(Sys.time() *. 0.01) ~z:1. (); GlDraw.begins `triangles; List.iter GlDraw.vertex2 [-1., -1.; 0., 1.; 1., -1.]; GlDraw.ends (); Glut.swapBuffers () in Glut.displayFunc ~cb:render; Glut.idleFunc ~cb:(Some Glut.postRedisplay); Glut.mainLoop () ================================================================= That's nice, only 14 lines of code and the example is done. :) But after I made the window with the triangle greater, this examplke slowed down extremely! :( It seems that it does not use the features of the graphics card for some reasons. (??!) I have a gentoo-linux and an nvidia graphics card in the PC. Running on AMD-64 architecture. The first days I didn't used the closed-source nvidia drivers and tried an old C-source I had written. It was a threded application; in one of the thredas I had temporarily inserted one of the OpenGL-examples from the RedBook. This was intended as aa placeholder for some time, until I would write my own OpenGL-stuff for that thread. In a small window that RedBook-example was amazingly fast. And it slowed down, when making the window bigger, but nevertheless was fast enough. When using "fog" effects, it slowed down extremely. Later I used the nvidia-driver and it was so amazingly much more faster than before, and slowing down, when making the window greater, was not such a big effect. Using fog nearly had no effect. The sources of the RedBook-example are written in C. And today I tried OCaml with lablgl and this simple triangle. In a small window it was circling very fast, but making the window bigger slowed down the circular velocity a lot! What's going on here? Is the lablgl-binding - for some reason - NOT using features that are using accelerated graphic-card's features? Is the binding relaying on non-accelerated functions? Or is the OCaml-code in the above example written in bad OpenGl-style? (But I see the keyword double-buffering in the example, so it should be fast (?!)) Or is OCaml itself slowing down for some reasons? As I didn't have changed the X11-settings (using X11-Xorg-Server) the same (accellerated) driver is running as it was as I tried the RedBook-examples. So there must be something with the above code or the lablgl-Lib or with OCaml that makes the application slowing down, when the window is enlarged. Someone who knows, what the problem is?! Thanks In Advance, Oliver Bandel