]> gitweb.factorcode.org Git - factor.git/commitdiff
fix potential garbled output
authorDoug Coleman <erg@secrets.local>
Sat, 1 Nov 2008 20:48:35 +0000 (15:48 -0500)
committerDoug Coleman <erg@secrets.local>
Sat, 1 Nov 2008 20:48:35 +0000 (15:48 -0500)
extra/cap/cap.factor

index 5f3ee7b96067b4b94b6ce6aacd7f88542302a6cf..ea5462acf22f328efb77e4a19c5f11f740c442f8 100644 (file)
@@ -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
 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
 
 : screenshot-array ( world -- byte-array )
@@ -9,7 +11,7 @@ IN: cap
 : gl-screenshot ( gadget -- byte-array )
     [
         GL_BACK glReadBuffer
-        GL_PACK_ALIGNMENT 1 glPixelStorei
+        GL_PACK_ALIGNMENT 4 glPixelStorei
         0 0
     ] dip
     [ dim>> first2 GL_BGR GL_UNSIGNED_BYTE ]
@@ -25,7 +27,4 @@ IN: cap
     [ screenshot ] dip save-bitmap ;
 
 : screenshot. ( window -- )
-    [ screenshot <graphics-gadget> ] [ title>> ] bi open-window ;
-
-
-
+    [ screenshot <graphics-gadget> ] [ title>> ] bi open-window ;