Created
May 8, 2021 04:06
-
-
Save AshyIsMe/270302a0e7b003a011aa83c3d0dcadef to your computer and use it in GitHub Desktop.
processing style playing with j
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NB. jgl2 animation demo for j | |
NB. Based on https://code.jsoftware.com/wiki/Guides/Window_Driver/Animation/Animated_JGL2 | |
NB. by (c) 2019 by michal j wallace http://tangentstorm.com/ | |
NB. free for use under the MIT license. https://opensource.org/licenses/MIT | |
load 'gl2' | |
coinsert 'jgl2' | |
close_handler =: 3 : 0 | |
wd 'timer 0;psel w0;pclose' | |
) | |
NB. janimate =: verb define | |
janimate =: monad define | |
wd 'pc w0;pn "J Animation"' NB. parent control (window) named 'w'. | |
wd 'minwh 500 500; cc g0 isidraw' NB. add an 'isidraw' child control named 'g' | |
wd 'pshow' NB. show the window at the given coordinates. | |
w0_close =: close_handler | |
NB. TODO broken: sys_timer_z_ =: x | |
sys_timer_z_ =: draw_base_ | |
wd 'timer 100' NB. start timer with this many ms between ticks | |
) | |
NB. TODO Why is this not rendering? | |
update=: 3 : 'rects=: ? 4 4 $ 100' | |
render=: 3 : 'glrect rects' | |
draw=:render @ update | |
NB. janimate'' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The idea for usage is something along these lines: