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 8D310BC48 for ; Mon, 7 Mar 2005 15:04:46 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j27E4kcv007159 for ; Mon, 7 Mar 2005 15:04:46 +0100 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id PAA28176 for ; Mon, 7 Mar 2005 15:04:45 +0100 (MET) Received: from mail2.bluewin.ch (mail2.bluewin.ch [195.186.4.73]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j27E4jMq007156 for ; Mon, 7 Mar 2005 15:04:45 +0100 Received: from [10.0.1.2] (213.3.46.156) by mail2.bluewin.ch (Bluewin AG 7.0.035) id 422A2BE50002CAF4; Mon, 7 Mar 2005 14:04:45 +0000 In-Reply-To: <200503020818.16207.jon@jdh30.plus.com> References: <200503020818.16207.jon@jdh30.plus.com> Mime-Version: 1.0 (Apple Message framework v619.2) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: Content-Transfer-Encoding: 7bit Cc: caml-list@inria.fr From: =?ISO-8859-1?Q?Daniel_B=FCnzli?= Subject: Re: [Caml-list] lablGL and the top-level Date: Mon, 7 Mar 2005 15:05:02 +0100 To: Jon Harrop X-Mailer: Apple Mail (2.619.2) X-Miltered: at nez-perce with ID 422C5F7E.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 422C5F7D.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; epfl:01 caml-list:01 lablgl:01 toplevel:01 toplevel:01 threads:01 toploop:01 toploop:01 ocamlsdl:01 sourceforge:01 ...:98 simpler:01 glut:01 glut:01 interaction: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: Jon, Just in case you are not aware your problem is easy to solve if you use sdl [1] instead of glut to setup your gl context and handle input. Sdl doesn't own your main loop, you can poll or wait for events and then continue with your own code. This simplifies a lot the interaction with the toplevel. For example, you can enter a function from the toplevel which will handle user input until the user presses escape to return to the toplevel and reenter the function later again. Or you can just initialize the context and then paint your window from the toplevel without handling the input in the window. The features you loose with respect to glut is menus and multiple windows. But with sdl you don't need threads to solve your problem, you control the loop and this may be simpler for students (unless you want to introduce them to concurrency at the same time...). A more brittle path to follow (with glut or whatever) which I did not investigate deeply is to use the (hidden) Toploop module and to try to render and control the toplevel in one of your glut window. However I don't know enough about Toploop to be sure you can get to the expected result. Daniel [1]