Rendering tweaks

db4
Slava Pestov 2008-11-18 14:15:38 -06:00
parent f32908f502
commit d0e53db5fc
4 changed files with 6 additions and 5 deletions

View File

@ -64,7 +64,8 @@ MACRO: all-enabled-client-state ( seq quot -- )
[ 2 GL_FLOAT 0 ] dip glTexCoordPointer ; inline
: line-vertices ( a b -- )
append >c-float-array gl-vertex-pointer ;
[ first2 [ 0.5 + ] bi@ ] bi@ 4 narray
>c-float-array gl-vertex-pointer ;
: gl-line ( a b -- )
line-vertices GL_LINES 0 2 glDrawArrays ;

View File

@ -111,8 +111,8 @@ TUPLE: checkmark-paint < caching-pen color last-vertices ;
: checkmark-points ( dim -- points )
{
[ { 0 0 } v* { 0 1 } v+ ]
[ { 1 1 } v* { 0 1 } v+ ]
[ { 0 0 } v* ]
[ { 1 1 } v* ]
[ { 0 1 } v* ]
[ { 1 0 } v* ]
} cleave 4array ;

View File

@ -112,7 +112,7 @@ M: editor ungraft*
line-height * ;
: caret-loc ( editor -- loc )
[ editor-caret* ] keep 2dup loc>x 1+
[ editor-caret* ] keep 2dup loc>x
rot first rot line>y 2array ;
: caret-dim ( editor -- dim )

View File

@ -27,7 +27,7 @@ M: grid-lines draw-boundary
dup grid set
dup rect-dim half-gap v- grid-dim set
compute-grid
[ { 1 0 } draw-grid-lines ]
[ { -0.5 -0.5 } gl-translate { 1 0 } draw-grid-lines ]
[
{ 0.5 -0.5 } gl-translate
{ 0 1 } draw-grid-lines