[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: MacOSX compatibility : detachDrawingThread:toTarget:withObject:
From: |
Adam Fedor |
Subject: |
Re: MacOSX compatibility : detachDrawingThread:toTarget:withObject: |
Date: |
Mon, 20 Aug 2001 15:25:42 -0600 |
User-agent: |
Mozilla/5.0 (X11; U; Linux ppc; en-US; rv:0.9.2) Gecko/20010630 |
Pierre-Yves Rivaille wrote:
On Sun, 19 Aug 2001, Adam Fedor wrote:
I think (I will check as soon as I get back to my MOSX cube) that
multithread drawing is implemented through multiple context.
I didn't originally think that would work, but I guess it is possible.
[NSGraphicsContext setCurrentContext:
[NSGraphicsContext graphicsContextWithWindow: window]];
This implies that you can only draw into a window with the same context
which the window has been created with (i.e. you can't draw into a
window with two different contexts).
So the problem is does GNUstep backend (xgps/xdps) support multiple
contexts ? According to the NEWS file in dgs, it seems that the support is
not so good when using xdps + dgs.
dgs does not, but the backends themsleves do (I'd recomment xgps). It
hasn't been tested at all though.
The first problem I found when using xgps with the previous chunk of code,
is in [NSWindow gstate] which gives back a value which is related to the
main thread context and causes a crash when called by a thread using its
own GraphicsContext.
Well the previous code indicates that this is the correct behaviour
(well perhaps it shouldn't crash...). Although we could extend this by
adding a window method -gstateWithContext:
There may be other issues but I can't really think of any now.
Adam Fedor, Digital Optics | Fudd's law of opposition: Push
fedor@doc.com http://www.doc.com | something hard enough, and it
fedor@gnu.org http://www.gnustep.org | will fall over.