]> gitweb.factorcode.org Git - factor.git/commitdiff
need to pass world as arg to pixel-format hooks
authorJoe Groff <arcata@gmail.com>
Sat, 2 May 2009 17:31:33 +0000 (12:31 -0500)
committerJoe Groff <arcata@gmail.com>
Sat, 2 May 2009 17:31:33 +0000 (12:31 -0500)
basis/ui/backend/cocoa/cocoa.factor
basis/ui/gadgets/worlds/worlds.factor
basis/ui/pixel-formats/pixel-formats.factor

index 297996e9db5797c3cc36f32687a1323cbde6ba0c..a4dbf670e2d2fcb7b0883ac1db9b6673debd361f 100755 (executable)
@@ -51,14 +51,14 @@ PIXEL-FORMAT-ATTRIBUTE-TABLE: NSOpenGLPFA { } H{
 PRIVATE>
 
 M: cocoa-ui-backend (make-pixel-format)
-    >NSOpenGLPFA-int-array
+    nip >NSOpenGLPFA-int-array
     NSOpenGLPixelFormat -> alloc swap -> initWithAttributes: ;
 
 M: cocoa-ui-backend (free-pixel-format)
-    -> release ;
+    handle>> -> release ;
 
 M: cocoa-ui-backend (pixel-format-attribute)
-    >NSOpenGLPFA
+    [ handle>> ] [ >NSOpenGLPFA ] bi*
     [ drop f ]
     [ first 0 <int> [ swap 0 -> getValues:forAttribute:forVirtualScreen: ] keep *int ]
     if-empty ;
index 0328d453d4f2ab56cff8d07dd168da20b9b89ebe..c66e59b292bd1859ff0fba7bbc69e7007e5be933 100644 (file)
@@ -157,5 +157,5 @@ M: world world-pixel-format-attributes
     { windowed double-buffered T{ depth-bits { value 16 } } } ;
 
 : with-world-pixel-format ( world quot -- )
-    [ dup world-pixel-format-attributes <pixel-format> ]
+    [ dup dup world-pixel-format-attributes <pixel-format> ]
     dip with-disposal ; inline
index dc613604a6b2665a940bf3f114c10aa3b0353520..98b1dab88e0519596a4901e6b8d3f4ffa554012d 100644 (file)
@@ -43,23 +43,23 @@ TUPLE: buffer-level < pixel-format-attribute ;
 TUPLE: sample-buffers < pixel-format-attribute ;
 TUPLE: samples < pixel-format-attribute ;
 
-HOOK: (make-pixel-format) ui-backend ( attributes -- pixel-format-handle )
-HOOK: (free-pixel-format) ui-backend ( pixel-format-handle -- )
-HOOK: (pixel-format-attribute) ui-backend ( pixel-format-handle attribute-name -- value )
+HOOK: (make-pixel-format) ui-backend ( world attributes -- pixel-format-handle )
+HOOK: (free-pixel-format) ui-backend ( pixel-format -- )
+HOOK: (pixel-format-attribute) ui-backend ( pixel-format attribute-name -- value )
 
-ERROR: invalid-pixel-format-attributes attributes ;
+ERROR: invalid-pixel-format-attributes world attributes ;
 
-TUPLE: pixel-format handle ;
+TUPLE: pixel-format world handle ;
 
-: <pixel-format> ( attributes -- pixel-format )
-    dup (make-pixel-format)
+: <pixel-format> ( world attributes -- pixel-format )
+    2dup (make-pixel-format)
     [ nip pixel-format boa ] [ invalid-pixel-format-attributes ] if* ;
 
 M: pixel-format dispose
-    [ [ (free-pixel-format) ] when* f ] change-handle drop ;
+    [ (free-pixel-format) ] [ f >>handle drop ] bi ;
 
 : pixel-format-attribute ( pixel-format attribute-name -- value )
-    [ handle>> ] dip (pixel-format-attribute) ;
+    (pixel-format-attribute) ;
 
 <PRIVATE