[racket] Error with pict3d

From: Neil Toronto (neil.toronto at gmail.com)
Date: Sat Mar 14 21:00:39 EDT 2015

You're not doing anything wrong. Pict3D requires OpenGL version 3.0 or 
higher to function, and it looks like your computer doesn't have it.

To find out for sure, here's what you can do:

  * Mac OS X: Check the OS version number. You need 10.7.5 or higher.

  * Linux: Run

      glxinfo | grep "version"

    on the command line. Ignore every output line about GLX or shading.

  * Windows: Download and run the OpenGL Extensions Viewer from
    realtech-vr.com.

If you don't want to download and install more software (which I would 
totally understand), run the following program.


#lang racket

(require racket/gui
          sgl/gl)

(define (get-graphics-info legacy?)
   (define config (new gl-config%))
   (send config set-legacy? legacy?)
   (define frame (new frame% [label "Test"] [width 100] [height 100]))
   (define canvas (new canvas%
                       [parent frame]
                       [style '(gl no-autoclear)]
                       [gl-config config]))
   (send frame show #t)
   (sleep 1)
   (begin0
     (send (send (send canvas get-dc) get-gl-context)
           call-as-current
           (λ ()
             (list (glGetString GL_VENDOR)
                   (glGetString GL_RENDERER)
                   (glGetString GL_VERSION))))
     (send frame show #f)))

(get-graphics-info #t)
(get-graphics-info #f)


I get this output:

   '("Intel Open Source Technology Center"
     "Mesa DRI Intel(R) Haswell Mobile "
     "3.0 Mesa 10.1.3")
   '("Intel Open Source Technology Center"
     "Mesa DRI Intel(R) Haswell Mobile "
     "3.3 (Core Profile) Mesa 10.1.3")


If doing one of these shows that you have OpenGL version 3.0 or higher, 
there's probably an error in how Racket gets OpenGL contexts.

Neil ⊥

On 03/14/2015 02:49 AM, Dr. C. SHUNMUGA VELAYUTHAM  wrote:
> When I tried to run the first example of the pict3d doc
>
> (require pict3d)
> (current-pict3d-legacy? #t)
> (sphere origin 1/2)
>
> I get the following error message
>
> get-master-gl-context: could not get at least an OpenGL 30 context (legacy? = #f)
>    context...:
>     /home/csvelayutham/racket/collects/racket/private/more-scheme.rkt:370:13: hash-ref!
>     /home/csvelayutham/.racket/6.1.1/pkgs/pict3d/pict3d/private/gui/pict3d-snip.rkt:103:7
>     /home/csvelayutham/.racket/6.1.1/pkgs/pict3d/pict3d/private/gui/pict3d-snip.rkt:91:2: render-thread-loop
>
> After this following the document, I inserted the (current-pict3d-legacy? #t)
>
> (require pict3d)
> (current-pict3d-legacy? #t)
> (sphere origin 1/2)
>
> Still I get the following error message
>
> get-master-gl-context: could not get at least an OpenGL 30 context (legacy? = #t)
>    context...:
>     /home/csvelayutham/racket/collects/racket/private/more-scheme.rkt:370:13: hash-ref!
>     /home/csvelayutham/.racket/6.1.1/pkgs/pict3d/pict3d/private/gui/pict3d-snip.rkt:103:7
>     /home/csvelayutham/.racket/6.1.1/pkgs/pict3d/pict3d/private/gui/pict3d-snip.rkt:91:2: render-thread-loop
>
> Am I going wrong somewhere?
>
>
> C. Shunmuga Velayutham
> ____________________
>    Racket Users list:
>    http://lists.racket-lang.org/users
>


Posted on the users mailing list.