Handbook
Glossary
gl-screenshot ( gadget -- byte-array )
Vocabulary
cap
.
private
Inputs
gadget
an
object
Outputs
byte-array
an
object
Definition
USING:
accessors
kernel
math
opengl
opengl.gl
sequences
ui.gadgets.worlds
;
IN:
cap.private
:
gl-screenshot
( gadget -- byte-array )
[
find-gl-context
]
[
[
GL_BACK
glReadBuffer
GL_PACK_ALIGNMENT
4
glPixelStorei
0 0
]
dip
dim>>
first2
[
gl-scale
>fixnum
]
bi@
GL_RGBA
GL_UNSIGNED_BYTE
]
[
screenshot-array
]
tri
[
glReadPixels
]
keep
;