[racket] openGL on Mac OS

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Wed Jun 27 17:54:36 EDT 2012

At Wed, 27 Jun 2012 23:14:21 +0200, Petr Samarin wrote:
> I was trying out some examples from the documentation and used openGL code 
> outside of openGL context!

That makes sense. I vaguely recall that Apple's GL is likely to crash
without a context, while other GL implementations tend not to crash in
that case.

I'm not sure of the right way to add a check for a context. The context
is determined outside of the GL API, and the `sgl' library inherits the
assumption that a context will be set somehow --- possibly via
`racket/gui', but possibly through some other library.

One possibility is to introduce a third library that GL libraries like
`sgl' and context-supplying libraries like `racket/gui' could use to
communicate o the availability of a context. If `sgl' insists that a
context is available according to the next library, then there's an
issue of backward compatibility (in case someone uses `sgl' with
contexts other than from `racket/gui'). Also, I think a check
implemented that way might significantly affect performance.

Any other ideas?

Posted on the users mailing list.