Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jello sample bad responsiveness #149

Open
GoogleCodeExporter opened this issue Aug 19, 2015 · 0 comments
Open

jello sample bad responsiveness #149

GoogleCodeExporter opened this issue Aug 19, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

Not a bug really.
Jello example shows bad responsiveness because handle-event function process 
only one input event at a time.
Better would be to process all events, sort of this:

--- jello.orig.scm  2011-04-15 16:37:06.000000000 +0300
+++ jello.scm   2011-04-15 20:07:58.000000000 +0300
@@ -827,6 +827,7 @@

   (define handle-event
     (lambda ()
+     (let loop ()
       (when (> (SDL_PollEvent event) 0)
         (let ((type (SDL_Event-type event)))
           (cond ((= type SDL_MOUSEBUTTONDOWN) (exit-game 0))
@@ -853,7 +854,8 @@
                          ((< x (- 640 paddle-width))
                           (set! paddle-x x))
                          (else
-                          (set! paddle-x (- 640 paddle-width)))))))))))
+                          (set! paddle-x (- 640 paddle-width))))))))
+        (loop)))))

   (define game-main
     (lambda ()


Original issue reported on code.google.com by [email protected] on 15 Apr 2011 at 6:08

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant