[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
XOR drawing in Cocoa
Quartz does not support XOR drawing.
For temporary drawing use NSWindow's - cacheImageInRect: and
- restoreCachedImage
However, I doubt they will work with hardware accelerate OpenGL. Why not
just draw your temporary selection lines with OpenGL ? You could even use a
stencil buffer for overlay effects.
----- Original Message -----
From: "Joe Esch" <joe@xxxxxxxxxxxx>
To: "Mac OS X Dev" <macosx-dev@xxxxxxxxxxxxx>
Sent: Sunday, March 03, 2002 11:23 AM
Subject: Re: XOR drawing in Cocoa
> Looking farther, I found NSFrameRectWithWidthUsingOperation. This sounds
> like it should do what I want in one case - which is to draw a selection
> rectangle while dragging (although it is Description forthcoming, so who
can
> say for sure.)
>
> It sounds like XOR drawing must be supported at some level for it to be
> available to this function. Unfortunately, it doesn't seem to be exposed
> any place except for this function, a couple of FillRect functions and
> images.
>
> Unfortunaetly, I don't think that NSFrameRectWithWidthUsingOperation will
> work for me because I want to draw over an NSOpenGLView. As far as I can
> tell (after trying lots of different things yesterday) you cannot draw
over
> an NSOpenGLView with non OpenGL functions.
>
> Based on my observations, I am also guesing that - cacheImageInRect: will
> not work when you have an NSOpenGLView.
>
> ----- Original Message -----
> From: "Dan Crevier" <Dan.Crevier@xxxxxxxxx>
> To: "Joe Esch" <joe@xxxxxxxxxxxx>; "Mac OS X Dev"
<macosx-dev@xxxxxxxxxxxxx>
> Sent: Saturday, March 02, 2002 10:47 PM
> Subject: Re: XOR drawing in Cocoa
>
>
> > On 3/2/2002 9:38 AM, "Joe Esch" <joe@xxxxxxxxxxxx> wrote:
> >
> > > Is there any way to do XOR drawing in Cocoa? I haven't been able to
> find
> > > anything in NSBezierPath or NSColor. I have seen examples using
> NSImage,
> > > but I would like to do line drawing.
> >
> > Quartz doesn't support XOR mode, AFAIK...
> >
> > Dan
> >
> > _______________________________________________
> > MacOSX-dev mailing list
> > MacOSX-dev@xxxxxxxxxxxxx
> > http://www.omnigroup.com/mailman/listinfo/macosx-dev
> >
> >
>
> _______________________________________________
> MacOSX-dev mailing list
> MacOSX-dev@xxxxxxxxxxxxx
> http://www.omnigroup.com/mailman/listinfo/macosx-dev
>