Re-implement <polygon-gadget> since joystick-demo still uses it
parent
58582ab4d9
commit
073333f245
|
@ -1,7 +1,8 @@
|
|||
! Copyright (C) 2009 Slava Pestov.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: accessors colors help.markup help.syntax kernel opengl
|
||||
opengl.gl sequences specialized-arrays.float ui.pens ;
|
||||
opengl.gl sequences specialized-arrays.float math.vectors
|
||||
ui.gadgets ui.pens ;
|
||||
IN: ui.pens.polygon
|
||||
|
||||
! Polygon pen
|
||||
|
@ -30,4 +31,8 @@ M: polygon draw-interior
|
|||
[ color>> gl-color ]
|
||||
[ interior-vertices>> gl-vertex-pointer ]
|
||||
[ [ GL_POLYGON 0 ] dip interior-count>> glDrawArrays ]
|
||||
tri ;
|
||||
tri ;
|
||||
|
||||
: <polygon-gadget> ( color points -- gadget )
|
||||
[ <polygon> ] [ { 0 0 } [ vmax ] reduce ] bi
|
||||
[ <gadget> ] 2dip [ >>interior ] [ >>dim ] bi* ;
|
Loading…
Reference in New Issue