]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/windows/offscreen/offscreen.factor
The use of factor.com does not fix the issue with missing stdout on Github
[factor.git] / basis / windows / offscreen / offscreen.factor
old mode 100755 (executable)
new mode 100644 (file)
index 63cfd92..ae05d80
@@ -1,13 +1,13 @@
 ! Copyright (C) 2009 Joe Groff, Slava Pestov.
-! See http://factorcode.org/license.txt for BSD license.
-USING: alien.c-types kernel combinators sequences
-math windows.gdi32 windows.types images destructors
-accessors fry locals classes.struct ;
+! See https://factorcode.org/license.txt for BSD license.
+USING: alien.c-types alien.data kernel combinators
+sequences math windows.gdi32 windows.types images
+destructors accessors fry locals classes.struct ;
 IN: windows.offscreen
 
 : (bitmap-info) ( dim -- BITMAPINFO )
     [
-        BITMAPINFO <struct>
+        BITMAPINFO new
         dup bmiHeader>>
         BITMAPINFOHEADER heap-size >>biSize
     ] dip
@@ -26,8 +26,8 @@ IN: windows.offscreen
 : make-bitmap ( dim dc -- hBitmap bits )
     [ nip ]
     [
-        swap (bitmap-info) DIB_RGB_COLORS f <void*>
-        [ f 0 CreateDIBSection ] keep *void*
+        swap (bitmap-info) DIB_RGB_COLORS { void* }
+        [ f 0 CreateDIBSection ] with-out-parameters
     ] 2bi
     [ [ SelectObject drop ] keep ] dip ;
 
@@ -46,7 +46,7 @@ IN: windows.offscreen
         ubyte-components >>component-type
         t >>upside-down? ;
 
-: with-memory-dc ( quot: ( hDC -- ) -- )
+: with-memory-dc ( ..a quot: ( ..a hDC -- ..b ) -- ..b )
     [ [ f CreateCompatibleDC &DeleteDC ] dip call ] with-destructors ; inline
 
 :: make-bitmap-image ( dim dc quot -- image )