Add execute-fn-on-gl! function

This commit is contained in:
oakes
2014-09-01 23:18:11 -04:00
parent bf77d6b82d
commit d6b994602f

View File

@@ -76,12 +76,15 @@
(wrapper screen) (wrapper screen)
(reset-changed! entities old-entities) (reset-changed! entities old-entities)
(update-screen! @screen))))) (update-screen! @screen)))))
execute-fn-on-gl! (fn [& args]
(on-gl (apply execute-fn! args)))
update-fn! (fn [func args] update-fn! (fn [func args]
(doto (apply swap! screen func args) (doto (apply swap! screen func args)
update-screen!))] update-screen!))]
{:screen screen {:screen screen
:entities entities :entities entities
:execute-fn! execute-fn! :execute-fn! execute-fn!
:execute-fn-on-gl! execute-fn-on-gl!
:update-fn! update-fn! :update-fn! update-fn!
:options options :options options
:show (fn [] :show (fn []
@@ -92,6 +95,7 @@
(update-fn! assoc (update-fn! assoc
[:total-time 0 [:total-time 0
:execute-fn! execute-fn! :execute-fn! execute-fn!
:execute-fn-on-gl! execute-fn-on-gl!
:update-fn! update-fn! :update-fn! update-fn!
:options options :options options
:on-timer on-timer :on-timer on-timer