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>