use gl-look-at, and make gl-look-at more elegant

db4
Alex Chapman 2008-05-17 11:49:19 +10:00
parent 9f3baec4d2
commit 3a7faad878
2 changed files with 5 additions and 5 deletions

View 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 ;

View File

@ -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 ;