lispnik / iup

Common Lisp CFFI bindings to the IUP Portable User Interface library (pre-ALPHA)
Other
139 stars 7 forks source link

fix OpenGL example's idle callback. #61

Open i-makinori opened 11 months ago

i-makinori commented 11 months ago

Thank you for great Lisp GUI toolkit which can use OpenGL.

I make it animated by fixing idle callback at the OpenGL example of README.

      ;; FIXME      (iup-cffi::%iup-set-function :idle_action 'idle)
      ;; into
      (iup-cffi::%iup-set-function :idle_action (cffi:callback idle-cb))
;;; FIXME
;; (cffi:defcallback idle-cb :int ()
;; ...
;; into
(cffi:defcallback idle-cb :int ()
  (incf *tt*)
  (iup-gl:make-current *canvas*)
  (repaint *canvas* 0 0) ;; FIXME: true posx posy. or simply, call canvas action.
  iup::+default+)

referenced : iup-examples/examples/C/gl/opengl3D.c at master · LuaDist/iup-examples