Handbook
Glossary
draw-interior ( gadget pen -- )
Factor handbook
»
UI framework
»
Implementing new gadgets
»
Customizing gadget appearance
»
UI pen protocol
Next:
draw-boundary ( gadget pen -- )
Vocabulary
ui
.
pens
Inputs
gadget
a
gadget
pen
an
object
Outputs
None
Generic word contract
Draws the interior of a gadget by making OpenGL calls. The
interior
slot may be set to objects implementing this generic word.
Definition
IN:
ui.pens
GENERIC:
draw-interior
( gadget pen -- )
Methods
USING:
kernel
ui.gadgets.buttons
ui.pens
;
M:
button-pen
draw-interior
lookup-button-pen
[
draw-interior
]
[
drop
]
if*
;
USING:
accessors
combinators
opengl
ui.pens
ui.pens.caching
ui.pens.gradient
ui.pens.gradient.private
;
M:
gradient
draw-interior
{
[
compute-pen
]
[
last-vertices>>
gl-vertex-pointer
]
[
last-colors>>
gl-color-pointer
]
[
colors>>
draw-gradient
]
}
cleave
;
USING:
accessors
kernel
math
opengl
sequences
ui.images
ui.pens
ui.pens.image
;
M:
image-pen
draw-interior
[
dim>>
]
[
[
image>>
]
[
fill?>>
]
bi
]
bi*
[
draw-scaled-image
]
[
[
image-dim
[
-
2
/i
]
2map
]
keep
[
draw-image
]
curry
with-translation
]
if
;
USING:
kernel
opengl
ui.pens
ui.render.test
;
M:
line-test
draw-interior
2drop
{
0 0
}
{
0 10
}
gl-line
;
USING:
accessors
kernel
opengl
opengl.gl
ui.pens
ui.pens.polygon
;
M:
polygon
draw-interior
nip
[
color>>
gl-color
]
[
interior-vertices>>
gl-vertex-pointer
]
[
[
GL_POLYGON
0
]
dip
interior-count>>
glDrawArrays
]
tri
;
USING:
accessors
kernel
math
opengl
opengl.gl
sequences
ui.pens
ui.pens.rounded
ui.pens.rounded.private
;
M:
rounded
draw-interior
[
(rounded)
GL_POLYGON
0
]
[
interior-vertices>>
]
bi
[
gl-vertex-pointer
]
[
length
2/
glDrawArrays
]
bi
;
USING:
accessors
kernel
math.vectors
opengl
ui.gadgets.menus.private
ui.pens
;
M:
separator-pen
draw-interior
color>>
gl-color
dim>>
[
{
0 0.5
}
v*
]
[
{
1 0.5
}
v*
]
bi
[
v>integer
]
bi@
gl-line
;
USING:
kernel
ui.gadgets.sliders.private
ui.pens
;
M:
slider-pen
draw-interior
dupd
current-pen
draw-interior
;
USING:
accessors
kernel
opengl
ui.pens
ui.pens.solid
ui.pens.solid.private
;
M:
solid
draw-interior
[
(solid)
]
[
interior-vertices>>
gl-vertex-pointer
]
bi
(gl-fill-rect)
;
USING:
combinators
kernel
ui.pens
ui.pens.tile
;
M:
tile-pen
draw-interior
{
[
nip
>tile-pen<
]
[
compute-tile-xs
]
[
compute-tile-widths
]
[
drop
]
}
2cleave
[
render-tile
]
curry
tri-curry@
tri-curry*
tri*
;