Remove unused circle rendering code

db4
Slava Pestov 2009-02-15 06:09:04 -06:00
parent 8fec1f5d40
commit 758ba5bcea
2 changed files with 7 additions and 32 deletions

View File

@ -3,11 +3,10 @@
! Portions copyright (C) 2008 Joe Groff. ! Portions copyright (C) 2008 Joe Groff.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: alien alien.c-types continuations kernel libc math macros USING: alien alien.c-types continuations kernel libc math macros
namespaces math.vectors math.constants math.functions namespaces math.vectors math.parser opengl.gl opengl.glu
math.parser opengl.gl opengl.glu combinators arrays sequences combinators arrays sequences splitting words byte-arrays assocs
splitting words byte-arrays assocs colors colors.constants accessors colors colors.constants accessors generalizations locals fry
generalizations locals fry specialized-arrays.float specialized-arrays.float specialized-arrays.uint ;
specialized-arrays.uint ;
IN: opengl IN: opengl
: gl-color ( color -- ) >rgba-components glColor4d ; inline : gl-color ( color -- ) >rgba-components glColor4d ; inline
@ -109,33 +108,6 @@ MACRO: all-enabled-client-state ( seq quot -- )
: do-attribs ( bits quot -- ) : do-attribs ( bits quot -- )
swap glPushAttrib call glPopAttrib ; inline swap glPushAttrib call glPopAttrib ; inline
: circle-steps ( steps -- angles )
dup length v/n 2 pi * v*n ;
: unit-circle ( angles -- points1 points2 )
[ [ sin ] map ] [ [ cos ] map ] bi ;
: adjust-points ( points1 points2 -- points1' points2' )
[ [ 1 + 0.5 * ] map ] bi@ ;
: scale-points ( loc dim points1 points2 -- points )
zip [ v* ] with map [ v+ ] with map ;
: circle-points ( loc dim steps -- points )
circle-steps unit-circle adjust-points scale-points ;
: close-path ( points -- points' )
dup first suffix ;
: circle-vertices ( loc dim steps -- vertices )
#! We use GL_LINE_STRIP with a duplicated first vertex
#! instead of GL_LINE_LOOP to work around a bug in Apple's
#! X3100 driver.
circle-points close-path concat >float-array ;
: fill-circle-vertices ( loc dim steps -- vertices )
circle-points concat >float-array ;
: (gen-gl-object) ( quot -- id ) : (gen-gl-object) ( quot -- id )
[ 1 0 <uint> ] dip keep *uint ; inline [ 1 0 <uint> ] dip keep *uint ; inline

View File

@ -10,6 +10,9 @@ interior-count
boundary-vertices boundary-vertices
boundary-count ; boundary-count ;
: close-path ( points -- points' )
dup first suffix ;
: <polygon> ( color points -- polygon ) : <polygon> ( color points -- polygon )
dup close-path [ [ concat >float-array ] [ length ] bi ] bi@ dup close-path [ [ concat >float-array ] [ length ] bi ] bi@
polygon boa ; polygon boa ;