From 02e961ac7750d7902f5858b54226b805aae46340 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Mon, 8 Dec 2008 21:00:47 -0800 Subject: [PATCH] cocoa ui compile fixes --- basis/cocoa/views/views.factor | 4 +--- basis/ui/cocoa/cocoa.factor | 14 +++++++------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/basis/cocoa/views/views.factor b/basis/cocoa/views/views.factor index f8e95dad40..dded68df4d 100644 --- a/basis/cocoa/views/views.factor +++ b/basis/cocoa/views/views.factor @@ -55,10 +55,8 @@ PRIVATE> : with-multisample ( quot -- ) t +multisample+ pick with-variable ; inline - - : ( attributes -- pixelfmt ) - NSOpenGLPixelFormat -> alloc [ + NSOpenGLPixelFormat -> alloc swap [ % NSOpenGLPFAWindow , NSOpenGLPFADoubleBuffer , diff --git a/basis/ui/cocoa/cocoa.factor b/basis/ui/cocoa/cocoa.factor index 811d35a8a1..e4fa95d08d 100644 --- a/basis/ui/cocoa/cocoa.factor +++ b/basis/ui/cocoa/cocoa.factor @@ -6,7 +6,7 @@ cocoa.runtime cocoa.subclassing cocoa.pasteboard cocoa.types cocoa.windows cocoa.classes cocoa.application sequences system ui ui.backend ui.clipboards ui.gadgets ui.gadgets.worlds ui.cocoa.views core-foundation threads math.geometry.rect fry -libc generalizations ; +libc generalizations alien.c-types cocoa.views combinators ; IN: ui.cocoa TUPLE: handle ; @@ -16,8 +16,8 @@ TUPLE: offscreen-handle < handle context buffer ; C: window-handle C: offscreen-handle -M: offscreen-handle window>> f ; -M: offscreen-handle view>> f ; +M: offscreen-handle window>> drop f ; +M: offscreen-handle view>> drop f ; SINGLETON: cocoa-ui-backend @@ -101,13 +101,13 @@ M: cocoa-ui-backend raise-window* ( world -- ) : offscreen-buffer ( world pixel-format -- alien w h pitch ) [ dim>> first2 ] [ pixel-size ] bi* - { [ * * malloc ] [ 2drop ] [ drop nip ] [ nip * ] } cleave ; + { [ * * malloc ] [ 2drop ] [ drop nip ] [ nip * ] } 3cleave ; : gadget-offscreen-context ( world -- context buffer ) - { NSOpenGLPFAOffscreen } - [ NSOpenGLContext -> alloc swap f -> initWithFormat:shareContext: ] + { NSOpenGLPFAOffScreen } + [ NSOpenGLContext -> alloc swap f -> initWithFormat:shareContext: dup ] [ offscreen-buffer ] bi - 4 npick [ setOffScreen:width:height:rowbytes: ] dip ; + 4 npick [ -> setOffScreen:width:height:rowbytes: ] dip ; M: cocoa-ui-backend (open-offscreen-buffer) ( world -- ) dup gadget-offscreen-context >>handle drop ;