need to pass world as arg to pixel-format hooks

db4
Joe Groff 2009-05-02 12:31:33 -05:00
parent 54e9447ec4
commit 621fed2dd5
3 changed files with 13 additions and 13 deletions

View File

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

View 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

View 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