From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id BF643BC8E for ; Wed, 23 Feb 2005 04:56:25 +0100 (CET) Received: from ptb-relay02.plus.net (ptb-relay02.plus.net [212.159.14.213]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j1N3uPhZ020789 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 23 Feb 2005 04:56:25 +0100 Received: from [80.229.56.224] (helo=chetara) by ptb-relay02.plus.net with esmtp (Exim) id 1D3ndQ-0000C5-SV for caml-list@yquem.inria.fr; Wed, 23 Feb 2005 03:56:24 +0000 From: Jon Harrop Organization: Flying Frog Consultancy Ltd. To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Cross-platform "Hello, World" graphical application in OCaml Date: Wed, 23 Feb 2005 03:57:45 +0000 User-Agent: KMail/1.7.1 References: <20050222120308.GA2975@furbychan.cocan.org> <200502230005.01479.jon@jdh30.plus.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200502230357.46234.jon@jdh30.plus.com> X-Miltered: at nez-perce with ID 421BFEE9.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 ocaml:01 wrote:01 ocaml:01 abstraction:01 guis:01 guis:01 mimic:01 lablglut:01 ...:98 frog:98 sticking:01 defined:01 opengl:01 opengl:01 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.2 X-Spam-Level: This is getting off topic so I'll keep it brief... On Wednesday 23 February 2005 03:13, Daniel B=FCnzli wrote: > a) An OpenGL context is not a lightweight structure. Especially if you > are doing realtime rendering, a context switch is a heavy operation. I've never had a performance problem with context switching. As a test, try= =20 running multiple copies of my OpenGL demos: http://www.ffconsultancy.com/products/ocaml_for_scientists/visualisation > Very often it is much more efficent to have a single context in which > you draw various subregion by setting the viewport and scissor rect > rather than creating many opengl contexts. If you want multiple windows you can't do this, of course. > b) OpenGL context management is not defined in the opengl specification > but by platform specific libraries (e.g. agl, wgl, glx, etc) that > behave quite differently and this means that you may run into various > issues (like platform dependent context texture sharing policy). Whatever library created the contexts for you tends to handle all that, e.g= =2E=20 =46LTK and Qt do. This isn't rocket science though. OpenGL users have to do= =20 this themselves if they want to use pbuffers, for example: http://www.chem.pwf.cam.ac.uk/~jdh30/programming/opengl/pbuffer/index.html > Sure but if they do then : > > 1) Either they don't work at the level of OpenGL. That is they use the > platform specific gui libraries to provide their cross-platform > abstraction. Then we are not talking about the same thing (I was > talking about opengl-based gui systems). I see, you were referring to toolkits which render native-like GUIs using=20 OpenGL. Sorry, I was talking about actually calling real native GUIs from a= n=20 OpenGL app. > 2) Or they try to mimic the platform-specific look in their rendering, > an imitation that can become obsolated by any system update. Yes. GLUI mimics Windows 9x using OpenGL, for example. > But looking at the end of your message I think that we may not be > talking about the same thing. Yes, I think we were talking at cross purposes. To recap, if you must have some native-looking windows in an OpenGL app, yo= u=20 should be able to implement it quite easily (in theory). In practice, I hav= e=20 been unable to do this from OCaml, so I'd be very interested if anyone has = a=20 demo of this working. :-) I'd suggest sticking to lablglut and writing your own GUI entirely using=20 OpenGL though, as I have found this to be much more stable. I don't really= =20 think users will be too bothered by a slightly-different-looking GUI though= ,=20 especially if it looks better. :-) =2D-=20 Dr Jon D Harrop, Flying Frog Consultancy Ltd. http://ffconsultancy.com