fix potential garbled output
parent
8a494a0da4
commit
c417f829bd
|
@ -1,6 +1,8 @@
|
||||||
|
! Copyright (C) 2008 Doug Coleman, Joe Groff.
|
||||||
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: accessors arrays byte-arrays kernel math namespaces
|
USING: accessors arrays byte-arrays kernel math namespaces
|
||||||
opengl.gl sequences math.vectors ui graphics.bitmap graphics.viewer
|
opengl.gl sequences math.vectors ui graphics.bitmap graphics.viewer
|
||||||
models opengl.framebuffers ui.gadgets.worlds ui.gadgets fry ;
|
models opengl.framebuffers ui.gadgets.worlds ui.gadgets fry alien.syntax ;
|
||||||
IN: cap
|
IN: cap
|
||||||
|
|
||||||
: screenshot-array ( world -- byte-array )
|
: screenshot-array ( world -- byte-array )
|
||||||
|
@ -9,7 +11,7 @@ IN: cap
|
||||||
: gl-screenshot ( gadget -- byte-array )
|
: gl-screenshot ( gadget -- byte-array )
|
||||||
[
|
[
|
||||||
GL_BACK glReadBuffer
|
GL_BACK glReadBuffer
|
||||||
GL_PACK_ALIGNMENT 1 glPixelStorei
|
GL_PACK_ALIGNMENT 4 glPixelStorei
|
||||||
0 0
|
0 0
|
||||||
] dip
|
] dip
|
||||||
[ dim>> first2 GL_BGR GL_UNSIGNED_BYTE ]
|
[ dim>> first2 GL_BGR GL_UNSIGNED_BYTE ]
|
||||||
|
@ -26,6 +28,3 @@ IN: cap
|
||||||
|
|
||||||
: screenshot. ( window -- )
|
: screenshot. ( window -- )
|
||||||
[ screenshot <graphics-gadget> ] [ title>> ] bi open-window ;
|
[ screenshot <graphics-gadget> ] [ title>> ] bi open-window ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue