Fix minor bunny bug
parent
dec21de6c3
commit
618962aa71
|
@ -1,12 +1,14 @@
|
|||
USING: tools.deploy.config ;
|
||||
V{
|
||||
H{
|
||||
{ deploy-math? t }
|
||||
{ deploy-reflection 1 }
|
||||
{ deploy-name "Bunny" }
|
||||
{ deploy-threads? t }
|
||||
{ deploy-word-props? f }
|
||||
{ "stop-after-last-window?" t }
|
||||
{ deploy-ui? t }
|
||||
{ deploy-io 3 }
|
||||
{ deploy-reflection 1 }
|
||||
{ deploy-compiler? t }
|
||||
{ deploy-math? t }
|
||||
{ deploy-word-props? f }
|
||||
{ deploy-word-defs? f }
|
||||
{ deploy-c-types? f }
|
||||
{ "stop-after-last-window?" t }
|
||||
{ deploy-name "Bunny" }
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
USING: arrays bunny.model bunny.cel-shaded
|
||||
combinators.lib continuations kernel math multiline
|
||||
opengl opengl.shaders opengl.framebuffers opengl.gl
|
||||
opengl.capabilities sequences ui.gadgets ;
|
||||
opengl.capabilities sequences ui.gadgets combinators.cleave ;
|
||||
IN: bunny.outlined
|
||||
|
||||
STRING: outlined-pass1-fragment-shader-main-source
|
||||
|
@ -177,7 +177,7 @@ TUPLE: bunny-outlined
|
|||
[ bunny-outlined-normal-texture [ delete-texture ] when* ]
|
||||
[ bunny-outlined-depth-texture [ delete-texture ] when* ]
|
||||
[ f swap set-bunny-outlined-framebuffer-dim ]
|
||||
} call-with
|
||||
} cleave
|
||||
] [ drop ] if ;
|
||||
|
||||
: remake-framebuffer-if-needed ( draw -- )
|
||||
|
@ -237,4 +237,4 @@ M: bunny-outlined dispose
|
|||
[ bunny-outlined-pass1-program [ delete-gl-program ] when* ]
|
||||
[ bunny-outlined-pass2-program [ delete-gl-program ] when* ]
|
||||
[ dispose-framebuffer ]
|
||||
} call-with ;
|
||||
} cleave ;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
USING: arrays combinators.lib kernel math math.functions math.vectors namespaces
|
||||
opengl opengl.gl sequences ui ui.gadgets ui.gestures ui.render ;
|
||||
opengl opengl.gl sequences ui ui.gadgets ui.gestures ui.render combinators.cleave ;
|
||||
IN: opengl.demo-support
|
||||
|
||||
: NEAR-PLANE 1.0 64.0 / ; inline
|
||||
|
@ -47,14 +47,15 @@ M: demo-gadget pref-dim* ( gadget -- dim )
|
|||
GL_COLOR_BUFFER_BIT GL_DEPTH_BUFFER_BIT bitor glClear
|
||||
GL_MODELVIEW glMatrixMode
|
||||
glLoadIdentity
|
||||
{ [ >r 0.0 0.0 r> demo-gadget-distance neg glTranslatef ]
|
||||
[ demo-gadget-pitch 1.0 0.0 0.0 glRotatef ]
|
||||
[ demo-gadget-yaw 0.0 1.0 0.0 glRotatef ] } call-with ;
|
||||
[ >r 0.0 0.0 r> demo-gadget-distance neg glTranslatef ]
|
||||
[ demo-gadget-pitch 1.0 0.0 0.0 glRotatef ]
|
||||
[ demo-gadget-yaw 0.0 1.0 0.0 glRotatef ]
|
||||
tri ;
|
||||
|
||||
: reset-last-drag-rel ( -- )
|
||||
{ 0 0 } last-drag-loc set ;
|
||||
{ 0 0 } last-drag-loc set-global ;
|
||||
: last-drag-rel ( -- rel )
|
||||
drag-loc [ last-drag-loc get v- ] keep last-drag-loc set ;
|
||||
drag-loc [ last-drag-loc get v- ] keep last-drag-loc set-global ;
|
||||
|
||||
: drag-yaw-pitch ( -- yaw pitch )
|
||||
last-drag-rel MOUSE-MOTION-SCALE v*n first2 ;
|
||||
|
|
Loading…
Reference in New Issue