diff --git a/extra/bunny/model/model.factor b/extra/bunny/model/model.factor index 3e00191108..255e6eb343 100755 --- a/extra/bunny/model/model.factor +++ b/extra/bunny/model/model.factor @@ -23,7 +23,7 @@ IN: bunny.model : n ( vs triple -- n ) swap [ nth ] curry map - dup third over first v- >r dup second swap first v- r> cross + [ [ second ] [ first ] bi v- ] [ [ third ] [ first ] bi v- ] bi cross vneg normalize ; : normal ( ns vs triple -- ) @@ -31,7 +31,7 @@ IN: bunny.model : normals ( vs is -- ns ) over length { 0.0 0.0 0.0 } -rot - [ >r 2dup r> normal ] each drop + [ [ 2dup ] dip normal ] each drop [ normalize ] map ; : read-model ( stream -- model ) diff --git a/extra/bunny/outlined/outlined.factor b/extra/bunny/outlined/outlined.factor index 3cf3f94d73..c91a895ce1 100755 --- a/extra/bunny/outlined/outlined.factor +++ b/extra/bunny/outlined/outlined.factor @@ -2,7 +2,7 @@ USING: arrays bunny.model bunny.cel-shaded continuations destructors kernel math multiline opengl opengl.shaders opengl.framebuffers opengl.gl opengl.demo-support fry opengl.capabilities sequences ui.gadgets combinators accessors -macros ; +macros locals ; IN: bunny.outlined STRING: outlined-pass1-fragment-shader-main-source @@ -143,19 +143,17 @@ TUPLE: bunny-outlined pass1-program pass2-program f f f f f bunny-outlined boa ] [ drop f ] if ; -: (framebuffer-texture) ( dim iformat xformat -- texture ) - swapd >r >r >r +:: (framebuffer-texture) ( dim iformat xformat -- texture ) GL_TEXTURE0 glActiveTexture gen-texture GL_TEXTURE_2D over glBindTexture GL_TEXTURE_2D GL_TEXTURE_WRAP_S GL_CLAMP glTexParameteri GL_TEXTURE_2D GL_TEXTURE_WRAP_T GL_CLAMP glTexParameteri GL_TEXTURE_2D GL_TEXTURE_MAG_FILTER GL_NEAREST glTexParameteri GL_TEXTURE_2D GL_TEXTURE_MIN_FILTER GL_NEAREST glTexParameteri - GL_TEXTURE_2D 0 r> r> first2 0 r> GL_UNSIGNED_BYTE f glTexImage2D ; + GL_TEXTURE_2D 0 iformat dim first2 0 xformat GL_UNSIGNED_BYTE f glTexImage2D ; -: (attach-framebuffer-texture) ( texture attachment -- ) - swap >r >r - GL_FRAMEBUFFER_EXT r> GL_TEXTURE_2D r> 0 glFramebufferTexture2DEXT +:: (attach-framebuffer-texture) ( texture attachment -- ) + GL_FRAMEBUFFER_EXT attachment GL_TEXTURE_2D texture 0 glFramebufferTexture2DEXT gl-error ; : (make-framebuffer) ( color-texture normal-texture depth-texture -- framebuffer ) diff --git a/extra/opengl/demo-support/demo-support.factor b/extra/opengl/demo-support/demo-support.factor index c1b656b6c8..c8fe2b4882 100755 --- a/extra/opengl/demo-support/demo-support.factor +++ b/extra/opengl/demo-support/demo-support.factor @@ -60,7 +60,7 @@ M: demo-gadget pref-dim* ( gadget -- dim ) ] [ GL_MODELVIEW glMatrixMode glLoadIdentity - [ >r 0.0 0.0 r> distance>> neg glTranslatef ] + [ [ 0.0 0.0 ] dip distance>> neg glTranslatef ] [ pitch>> 1.0 0.0 0.0 glRotatef ] [ yaw>> 0.0 1.0 0.0 glRotatef ] tri