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 ; GL_LIGHT0 GL_SPECULAR F{ 1.0 1.0 1.0 1.0 } >c-float-array glLightfv ;
: player-view ( player -- ) : player-view ( player -- )
[ location>> first3 ] [ location>> ]
[ [ location>> ] [ forward>> ] bi v+ first3 ] [ [ location>> ] [ forward>> ] bi v+ ]
[ up>> first3 ] tri gluLookAt ; [ up>> ] tri gl-look-at ;
: draw-jamshred ( jamshred width height -- ) : 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 swap glPushAttrib call glPopAttrib ; inline
: gl-look-at ( eye focus up -- ) : gl-look-at ( eye focus up -- )
>r >r first3 r> first3 r> first3 gluLookAt ; [ first3 ] tri@ gluLookAt ;
TUPLE: sprite loc dim dim2 dlist texture ; TUPLE: sprite loc dim dim2 dlist texture ;