need to pass world as arg to pixel-format hooks
parent
54e9447ec4
commit
621fed2dd5
|
@ -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 ;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue