[plt-scheme] SGL - swap-buffers

From: Ryan Jarvis (rjarvis at WPI.EDU)
Date: Mon Oct 13 11:36:13 EDT 2003

This is my first attempt at answering a support question (I'm usually on
the other end) but here goes...

>On Mon, 13 Oct 2003, Zbyszek Jurkiewicz wrote:
> (define (on-paint)
>   (send this with-gl-context (lambda () (draw)))
>   (send this swap-gl-buffers))
> ...
> (define (on-paint)
>   (send this with-gl-context
>          (lambda ()
>            (draw)
>            (send this swap-gl-buffers))))
> ...

When you redefine a method in a class, you can only give one lambda
expression, I believe.  The problem with your first code snippet is that
you have two expressions, a send and another send.

When I try to compile your code on a WinXP machine using DrScheme, I get
an error that says
(define: bad syntax (zero or multiple expressions after identifier)

Whereas your second snippet has only one expression, a send, it works

Try something like this
(define on-paint (lambda () (send a-canvas with-gl-context draw)

You can inherit the swap-gl-buffers method so you can call it
by itself without needing the (send this ...)


Posted on the users mailing list.