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 ;
{ 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
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