From 621fed2dd54c305de9d0e218f6cbd82f7a755a1c Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Sat, 2 May 2009 12:31:33 -0500 Subject: [PATCH] need to pass world as arg to pixel-format hooks --- basis/ui/backend/cocoa/cocoa.factor | 6 +++--- basis/ui/gadgets/worlds/worlds.factor | 2 +- basis/ui/pixel-formats/pixel-formats.factor | 18 +++++++++--------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/basis/ui/backend/cocoa/cocoa.factor b/basis/ui/backend/cocoa/cocoa.factor index 297996e9db..a4dbf670e2 100755 --- a/basis/ui/backend/cocoa/cocoa.factor +++ b/basis/ui/backend/cocoa/cocoa.factor @@ -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 [ swap 0 -> getValues:forAttribute:forVirtualScreen: ] keep *int ] if-empty ; diff --git a/basis/ui/gadgets/worlds/worlds.factor b/basis/ui/gadgets/worlds/worlds.factor index 0328d453d4..c66e59b292 100644 --- a/basis/ui/gadgets/worlds/worlds.factor +++ b/basis/ui/gadgets/worlds/worlds.factor @@ -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 ] + [ dup dup world-pixel-format-attributes ] dip with-disposal ; inline diff --git a/basis/ui/pixel-formats/pixel-formats.factor b/basis/ui/pixel-formats/pixel-formats.factor index dc613604a6..98b1dab88e 100644 --- a/basis/ui/pixel-formats/pixel-formats.factor +++ b/basis/ui/pixel-formats/pixel-formats.factor @@ -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 ; -: ( attributes -- pixel-format ) - dup (make-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) ;