[racket] openGL on Mac OS

From: Petr Samarin (petrsamarin at gmail.com)
Date: Wed Jun 27 17:14:21 EDT 2012

I was trying out some examples from the documentation and used openGL code outside of openGL context! Here is the code to reproduce the error:

(require sgl/gl
         sgl/gl-vectors)
(glBegin GL_TRIANGLES)
(glVertex3i 1 2 3)
(glVertex4fv (gl-float-vector 1 2 3 4))
(glEnd)

 It would be nice to get an error message instead of a segfault crash.


On Jun 27, 2012, at 9:13 PM, Matthew Flatt wrote:
> I don't have any immediate ideas. I've always used the Apple libraries,
> and they work for me.
> 
> Do you see the crash just running one of the GL-based games in the PLT
> Game application (such as Jewel or Gobblet)?
> 
> Can you send more of the crash report?
> 
> At Wed, 27 Jun 2012 15:04:43 +0200, Petr Samarin wrote:
>> FFI bindings for openGL do not work when "glu-lib" and "gl-lib" in gl.rkt are 
>> linked to Apple's own openGL libraries in:
>> "/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL"
>> "/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLU"
>> 
>> Any use of functions provided by (require sgl) library results in segmentation 
>> fault:
>> "Process scheme segmentation fault: 11"
>> 
>> And a crash report:
>> "
>> ...
>> Crashed Thread:  0  Dispatch queue: com.apple.main-thread
>> 
>> Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
>> Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000
>> ...
>> "
>> 
>> By linking the gl.rkt openGL from mac ports:
>> "/opt/local/lib/libGL"
>> "/opt/local/lib/libGLU"
>> 
>> the library works again.
>> 
>> What might be the cause for this?
>> 
>> 
>> ____________________
>>  Racket Users list:
>>  http://lists.racket-lang.org/users



Posted on the users mailing list.