call-as-current in gl-context<%>
Calls a thunk with this OpenGL context as the current context for OpenGL commands.
The method blocks to obtain a lock that represents the context, and it
releases the lock when the thunk returns or escapes. The lock
prevents interfence among OpenGL-using threads. If a thread is
terminated while holding the context lock, the lock is
released. Continuation jumps into the thunk do not grab the lock or
set the OpenGL context. See gl-context<%> for more
information on interference. The method accepts an alternate waitable
for use while blocking for the context lock; see
object-wait-multiple, section 7.6 in PLT MzScheme: Language Manual for more
information on waitables.
The result of the method call is the result of the thunk if it is called, or the result of the alternate waitable if it is chosen instead of the internal context-setting lock.
If
ok? returns #f at the time that this method is called, then
an exn:application:mismatch exception is raised.
( -> return value of send a-gl-context call-as-current thunk alternate enable-breaks?)thunk or waitable
thunk : a procedure of no arguments
alternate = : waitable
permanently blocked waitable
enable-breaks? = : boolean#f
If enable-breaks? is true, then the method uses
object-wait-multiple/enable-breaks, section 7.6 in PLT MzScheme: Language Manual
while blocking for the context-setting lock instead of
object-wait-multiple.