]> gitweb.factorcode.org Git - factor.git/commitdiff
use gl-look-at, and make gl-look-at more elegant
authorAlex Chapman <chapman.alex@gmail.com>
Sat, 17 May 2008 01:49:19 +0000 (11:49 +1000)
committerAlex Chapman <chapman.alex@gmail.com>
Sat, 17 May 2008 01:49:19 +0000 (11:49 +1000)
extra/jamshred/gl/gl.factor
extra/opengl/opengl.factor

index fe2009201f2d8f8ec90be5ec6275911ce39bab32..fffc97b4c69794af25604e60aece670b7a5ba789 100644 (file)
@@ -59,10 +59,10 @@ IN: jamshred.gl
     GL_LIGHT0 GL_SPECULAR F{ 1.0 1.0 1.0 1.0 } >c-float-array glLightfv ;
 
 : player-view ( player -- )
-    [ location>> first3 ]
-    [ [ location>> ] [ forward>> ] bi v+ first3 ]
-    [ up>> first3 ] tri gluLookAt ;
+    [ location>> ]
+    [ [ location>> ] [ forward>> ] bi v+ ]
+    [ up>> ] tri gl-look-at ;
 
 : draw-jamshred ( jamshred width height -- )
-    init-graphics jamshred-player dup player-view draw-tunnel ;
+    init-graphics jamshred-player [ player-view ] [ draw-tunnel ] bi ;
 
index ee58a4e3451a6a6d24a85a0612aba48aaa709464..a6e76cdc9e344da0287629e668cf2e8ff3e6f522 100755 (executable)
@@ -154,7 +154,7 @@ MACRO: set-draw-buffers ( buffers -- )
     swap glPushAttrib call glPopAttrib ; inline
 
 : gl-look-at ( eye focus up -- )
-    >r >r first3 r> first3 r> first3 gluLookAt ;
+    [ first3 ] tri@ gluLookAt ;
 
 TUPLE: sprite loc dim dim2 dlist texture ;