 |
 |
Buttons, etc on top of NSOpenGLView?
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Nov 2000
Status:
Offline
|
|
Hello ...
Is there a way to keep an NSOpenGLView from over-drawing buttons (and other elements), even when the view is below those elements?
Also, is there a way to make an NSOpenGLView transparent? I've tried setting the glClearColor with an alpha component of 0.0 and adding an isOpaque method that returns NO.
Thanks and regards,
DayLateDon
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Feb 2001
Location: Vancouver, WA
Status:
Offline
|
|
Thanks to 10.2 and QuartzExreme, yes.
For the first question, see /Developer/Examples/OpenGL/Cocoa/UnderlaySurface. For drawing an OpenGL view with partially transparent content "on top of" other views, do the same thing but reverse the SurfaceOrdering parameter you set on the NSOpenGLView instance. (At least, I think that's it, just off the top of my head.)
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Nov 2000
Status:
Offline
|
|
Thanks.
One of the relevant lines of code from the sample project was missing from a snippet I'd found in the Apple OpenGL mailing list. I can now put buttons and such on top of NSOpenGLViews.
Unfortunately, now the stuff in the view doesn't draw; the view is simply filled in with white. (If I remove the layer-shifting code, it draws fine.) And the buttons, after being clicked, have noticeably darker borders. Ugly.
Moreover, drawing performance has taken an _terrible_ nose dive. Even though I can't see my animations, I can monitor them. And what I've monitored is that sequences that used to take less than 1 second now take close to 10. (This on my iMac 400.)
So ... I guess I can re-arrange elements so that they don't overlap the OpenGL view (but after having tailored my graphics resources and drawing routines to what is probably the best of all possible layouts, I really don't want to do this). Or I can chuck the OpenGL port and go back to Quartz drawing in a custom view (but after experiencing some of the power and flexibility of OpenGL, I really don't want to do this either).
Or, I can figure out how to draw a single OpenGL scene off-screen somewhere and paste portions of it into separate views that avoid areas where the buttons are. Is this easy?
Regards,
DayLateDon
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Apr 2001
Location: Long Beach, CA
Status:
Offline
|
|
The first thing to note as that the iMac 400 would not support Quartz Extreme. If this stuff is highly dependent on QE, that may be the source of your problem. For example: on my iBook, a can run screen savers just fine. However, if I try to run them in the background, it is so incredibly slow that the machine becomes virtually unuseable. Also, it doesn't look right. This works just fine on my G4 though. This MAY be a large part of the problem.
|

ACSA 10.4/10.3, ACTC 10.3, ACHDS 10.3
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Nov 2000
Status:
Offline
|
|
Hello ...
If the surface layer ordering solution really does depend upon Quartz Extreme for acceptable performance, then I can't use it. (Not only can I not develop with QE on my iMac, but the customer base for the released product would be cut dramatically.)
Any pointers on copying areas of a single OpenGL scene to different views?
DayLateDon
|
|
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Oct 2001
Status:
Offline
|
|
In the AppKit documentation it recommends using a normal NSView and an NSOpenGLContext to draw within the view. I have used this and displayed NSImage's at the same time with no problem. I am not sure if it works with other objects but you may want to try this.
type r 503
|
|
I be that insane n***a from the psycho ward.
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|