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 7260BBC75 for ; Tue, 22 Feb 2005 22:22:10 +0100 (CET) Received: from ptb-relay03.plus.net (ptb-relay03.plus.net [212.159.14.214]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j1MLM97w014025 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 22 Feb 2005 22:22:10 +0100 Received: from [80.229.56.224] (helo=chetara) by ptb-relay03.plus.net with esmtp (Exim) id 1D3hTt-000EOn-E0 for caml-list@yquem.inria.fr; Tue, 22 Feb 2005 21:22:09 +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: Tue, 22 Feb 2005 21:23:31 +0000 User-Agent: KMail/1.7.1 References: <20050222120308.GA2975@furbychan.cocan.org> <200502221924.29080.jon@jdh30.plus.com> <20050222202426.GA25230@furbychan.cocan.org> In-Reply-To: <20050222202426.GA25230@furbychan.cocan.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200502222123.31485.jon@jdh30.plus.com> X-Miltered: at nez-perce with ID 421BA282.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 ocaml:01 wrote:01 wrote:01 wxwindows:01 widget:01 ocaml:01 vastly:01 guis:01 trivial:01 guis:01 animated:01 api:01 gtk:01 wxwindows: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: On Tuesday 22 February 2005 20:24, Richard Jones wrote: > On Tue, Feb 22, 2005 at 07:24:28PM +0000, Jon Harrop wrote: > > On Tuesday 22 February 2005 17:23, Richard Jones wrote: > > > WxWindows isn't really suitable for what I want to do because it > > > doesn't support a rich canvas widget, nor a good rich text editor. > > > > Does it support cross-platform OpenGL? If so then you could write your > > GUI in OpenGL... > > Joke, right? No, not at all. Just this afternoon, a friend of mine suggested that I commercialise the OCaml port of my vector graphics engine: http://www.chem.pwf.cam.ac.uk/~jdh30/programming/opengl/smoke/ The OCaml implementation is much more evolved and vastly easier to use, of course. In particular, it makes cross-platform GUIs relatively trivial. I didn't believe him though. I mean who would want to be able to write cross-platform GUIs easily? Especially smoothly animated ones with alpha blending, texture mapping and integrated 2D and 3D. Seriously though, if I did this, would anyone be interested in buying it to develop commercial applications with for, say, 1,000UKP? > Blender actually has a GUI written in OpenGL. One of > the remarkable consequences of this is that you can smoothly zoom and > sheer the controls ... Yes, if you're already using OpenGL then there are a lot of advantages to having an OpenGL-based GUI. Even if you're not already using OpenGL, it is the most cross-platform GUI-capable API and runs on virtually any modern computer, typically with performance orders of magnitude better than anything you'll get with Qt, GTK, WxWindows or any other software renderer. I develop for Linux and just had a go on another friend's Apple PowerBook. Once you've added <-cclib "-framework Foundation"> to the link line, the OCaml code compiles and runs beautifully. If you want some examples of trivial OpenGL programs written in OCaml, have a look at the freebies from my book: http://www.ffconsultancy.com/products/ocaml_for_scientists/visualisation There are Linux and Mac OS X executables you can just click on. Also, check out the examples which come with lablGL and lablglut. The main omission for me is then the lack of native-looking drop-down menus and a save dialog. I tried to port my lablglut-based code to lablgtk but failed miserably - I couldn't even get a window with a menu bar and a full-size OpenGL widget. Incidentally, would someone be so kind as to send me some Windows executables of my demos? Then we could have the full complement. :-) -- Dr Jon D Harrop, Flying Frog Consultancy Ltd. http://ffconsultancy.com