<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; ">I believe you need to <DIV><BR class="khtml-block-placeholder"></DIV><DIV>(inherit swap-gl-buffers</DIV><DIV>         with-gl-context)</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>and </DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>(define/override  (on-paint)</DIV><DIV>   (with-gl-context</DIV><DIV>    (lambda ()</DIV><DIV>      (draw-it)</DIV><DIV>      (swap-gl-buffers))))</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>The function draw-it is where you can unleash your hounds.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>rac</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR><DIV><DIV>On Mar 16, 2007, at 6:14 PM, Jonathan Thann wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite">Hi,<BR><BR>I'm a french student, and i'm trying to make a SHMUP (Shoot Them Up) game !<BR>My project is on a good way, but i still have a problem to activate an OpenGL double buffer.<BR><BR>I tried many things with the online help of DrScheme and i don't know what's wrong with my code... <BR><BR>I made a simple example to show you what my code looks like and to get some help ^^<BR>You can download it here (1,78 Ko) : <A href="http://dl.free.fr/Knxy41PR/trying-gl.rar" target="_new">http://dl.free.fr/Knxy41PR/trying-gl.rar </A><BR><BR>Or see it here :<BR><BR>------------------------------------------------------------<BR>(require (lib "sgl.ss" "sgl"))<BR><BR>(define MOUSEX 0)<BR>(define MOUSEY 0)<BR>(define REDX 0) ; Red square X position <BR>(define REDY 0) ; ---------- Y --------<BR>(define Dblack (make-object color% "black"))<BR><BR>(define background (make-object bitmap% "greySqr.jpg" 'jpeg #f)) ; Background<BR>(define blackSqr (make-object bitmap% " blackSqr.bmp" 'bmp #f)) ; 10*10 pixels full Black<BR>(define redSqr (make-object bitmap% "redSqr.bmp" 'bmp #f))        ; ----------------- Red<BR><BR>(define glTest (new gl-config%)) ; Gl-config<BR> <BR>(define-syntax while ; While<BR>  (syntax-rules ()<BR>    ((while test e1 e2 ...) (do ()<BR>                              ((not test) (void))<BR>                              e1 e2 ...))))<BR><BR>(define frame (new frame% <BR>                   (label "GL TEST")<BR>                   (min-width 300)<BR>                   (min-height 300)<BR>                   (stretchable-width #f)<BR>                   (stretchable-height #f)))<BR> <BR>(define vpanel (new vertical-panel%<BR>                    (parent frame)<BR>                    (alignment '(center center))))<BR><BR>(define my-canvas%<BR>  (class canvas%<BR>    (define/override (on-event evt)<BR>       (case (send evt get-event-type) <BR>        ((motion) (set! MOUSEX (send evt get-x))<BR>                  (set! MOUSEY (send evt get-y)))))<BR>    (super-new)))<BR><BR>(define canvas (new my-canvas% <BR>                    (parent vpanel) <BR>                    (style '(border))<BR>                    (min-width 300)<BR>                    (min-height 30)<BR>                    (gl-config glTest) ; Gl-config<BR>                    (paint-callback  <BR>                      (lambda (obj dc)<BR>                       (send dc get-gl-context)<BR>                       (send dc draw-bitmap<BR>                             background<BR>                             0<BR>                             0 <BR>                             'solid <BR>                             Dblack<BR>                             #f)<BR>                       (send dc draw-bitmap<BR>                             blackSqr<BR>                             (- MOUSEX 5) <BR>                             (- MOUSEY 5)<BR>                             'solid <BR>                             Dblack<BR>                             #f)<BR>                       (send dc draw-bitmap<BR>                             redSqr <BR>                             REDX<BR>                             REDY<BR>                             'solid <BR>                             Dblack<BR>                             #f)<BR>                       )))) <BR><BR>(define Refresh (thread (lambda()<BR>                          (while #t<BR>                            (sleep 0.01)<BR>                            (set! REDX (+ REDX 1))<BR>                            (set! REDY (+ REDY 1)) <BR>                            (send canvas refresh)))))<BR><BR>(send frame show #t)<BR>------------------------------------------------------------<BR><BR>Thanks !<BR>Jonathan.<BR><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">_________________________________________________</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-converted-space">  </SPAN>For list-related administrative tasks:</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-converted-space">  </SPAN><A href="http://list.cs.brown.edu/mailman/listinfo/plt-scheme">http://list.cs.brown.edu/mailman/listinfo/plt-scheme</A></DIV> </BLOCKQUOTE></DIV><BR></DIV></BODY></HTML>