caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Daniel Bünzli" <daniel.buenzli@erratique.ch>
To: Rich Neswold <rich.neswold@gmail.com>
Cc: "caml-list@inria.fr" <caml-list@inria.fr>
Subject: Re: [Caml-list] OpenGL and LWT
Date: Mon, 17 Mar 2014 15:05:46 +0100	[thread overview]
Message-ID: <3B63CC7A2A994E018E1EC2E450E0FFF4@erratique.ch> (raw)
In-Reply-To: <CAGT4q5oLJ+wZo9PMt2hj2zXqZ2GRc-0YVy2Jb6NeNMXcwQ7u2Q@mail.gmail.com>

Le lundi, 17 mars 2014 à 14:39, Rich Neswold a écrit :
> On Mon, Mar 17, 2014 at 5:32 AM, Ivan Gotovchits <ivg@ieee.org (mailto:ivg@ieee.org)> wrote:
> > Unfortunately, I don't know how LabGL is organized.
>  
> Most OpenGL bindings (including LabGL) include 'libglut', which is a
> library that is bundled with OpenGL that opens a UI window with an
> OpenGL context in it. It would be nice to use this library because it
> hides these details (i.e. the same code runs on Unix and MacOSX and
> Windows.) Unfortunately, the way libglut works is you call main_loop()
> which never returns. Before calling main_loop(), you register
> callbacks for mouse and keyboard events. You can also register a
> callback for periodic timeouts. Lastly, there's a callback which gets
> called whenever the libglut main loop is "idle" (with unspecified
> latencies, frequency, or guarantees.)

I wouldn't use glut which is no longer bundled on osx, is quite limited in functionality and reclaims your main loop. Use SDL, it provides similar functionality to setup an OpenGL context in a platform independent way but it doesn't reclaim control on your main() which will make integration with lwt trivial. There is:  

http://ocamlsdl.sourceforge.net/home.html

I also wrote newer and lower level bindings that target SDL2, they are not released yet but are becoming stable see:

https://sympa.inria.fr/sympa/arc/caml-list/2013-12/msg00105.html

(the heisenbug on osx mentioned in that message can be solved see [1]).  

Best,

Daniel

[1] http://lists.ocaml.org/pipermail/ctypes/2014-February/000066.html




  reply	other threads:[~2014-03-17 14:05 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-15 17:37 Richard Neswold
2014-03-17 10:09 ` Jeremie Dimino
2014-03-17 10:32   ` Ivan Gotovchits
2014-03-17 13:39     ` Rich Neswold
2014-03-17 14:05       ` Daniel Bünzli [this message]
2014-03-17 14:13         ` Daniel Bünzli
2014-03-17 22:50         ` Richard Neswold
2014-03-17 23:50           ` Daniel Bünzli
2014-03-19 12:01             ` Rich Neswold
2014-03-17 10:34   ` Török Edwin
2014-03-17 11:01     ` Daniel Bünzli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3B63CC7A2A994E018E1EC2E450E0FFF4@erratique.ch \
    --to=daniel.buenzli@erratique.ch \
    --cc=caml-list@inria.fr \
    --cc=rich.neswold@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).