X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=gacela.lisp;h=4197d22d077e2b488fc7f692d48285aced148848;hb=6a3d1ffb69036e6d4f1c239fd7d52f9bfc48d50c;hp=299ab90b9a21b328337bde69d2a8b598a5742b4d;hpb=bc04e12cf3c193c3b5620f3b6e0ded852f221fb8;p=gacela.git diff --git a/gacela.lisp b/gacela.lisp index 299ab90..4197d22 100644 --- a/gacela.lisp +++ b/gacela.lisp @@ -275,23 +275,24 @@ (init-video-mode) (set-game-code game-function) (cond ((not (game-running?)) - (init-frame-time) - (process-events) (game-loop))))) (let (running game-code) (defun game-loop () (setq running t) (do () ((quit?)) - (glClear (+ GL_COLOR_BUFFER_BIT GL_DEPTH_BUFFER_BIT)) - (to-origin) - (when (functionp game-code) (funcall game-code)) - (SDL_GL_SwapBuffers) - (delay-frame) (init-frame-time) (check-connections) (eval-from-clients) - (process-events)) + (process-events) + (cond ((not (quit?)) + (glClear (+ GL_COLOR_BUFFER_BIT GL_DEPTH_BUFFER_BIT)) + (to-origin) + (refresh-active-objects) + (when (functionp game-code) (funcall game-code)) + (render-objects) + (SDL_GL_SwapBuffers) + (delay-frame)))) (setq running nil)) (defun game-running? () @@ -304,7 +305,8 @@ (free-all-resources) (quit-audio) (quit-video-mode) - (quit-all-mobs) +; (quit-all-mobs) + (kill-all-objects) ; (clear-events) ; (quit-events) (quit-sdl))