[Larceny-users] GLUT and GL bindings ported from Ypsilon

William D Clinger will at ccs.neu.edu
Wed Feb 4 18:57:54 EST 2009


Eduardo Cavazos wrote:
> Larceny team, is there a similar form which can be used
> in our version of this file?

In Larceny, the closest equivalent would be something like

(define libGL
  (let ((os (cdr (assq 'os-name (system-features)))))
    (cond ((string=? os "MacOS X")
           (load-shared-object "OpenGL.framework/OpenGL"))
          ((string=? os "Win32")                                                
           (load-shared-object "opengl32.dll"))
          ((string=? os "Linux")                                                
           (load-shared-object "libGL.so.1"))
          ((string=? os "BSD Unix")
           (if (file-exists? "libGL.so")
               (load-shared-object "libGL.so")
               (load-shared-object "libGL.so.7.3")))
          ((string=? os "SunOS") ???)                ; Solaris
          ((string=? os "MacOS") ???)                ; MacOS 9
          ((string=? os "Unix") ???)                 ; unknown Unix
          (else
           (assertion-violation #f
            (string-append "can not locate OpenGL library,"
                           " unknown operating system"))))))

That's the current set of strings for recognized operating
systems.  The relevant code is in src/Rts/Sys/primitive.c
and src/Lib/Common/system-interface.sch

Will



More information about the Larceny-users mailing list