FROM : Sean McBride
DATE : Thu Feb 15 16:03:21 2007
On 2007-02-14 16:33, Matt Trinneer said:
>I've been trying to figure this out for a while but am having a
>little trouble, being new to Cocoa, and OO programming in general.
>Here goes: Is it possible to draw Interface Builder controls such as
>buttons, sliders, etc. in an OpenGL view? I've figured out how to
>capture bitmap representations of controls and render those in OpenGL
>space. What I'd like to do is create 2D representations of these
>controls in a 3D OpenGL context, while retaining the ability to
>respond to user inputs using the interface elements built in event
>handling, action, and output functionality . From my reading so far
>OpenGL seems like a suitable candidate for the 3D rendering
>environment. However I can't figure out if there is built-in Cocoa
>functionality to accomplish this, or, if I'd have to build it myself.
I have investigated this recently. As others have said, overlapping
views are in general not advised. You'll want to look at the
"UnderlaySurface" example. It is installed with Xcode here:
/Developer/Examples/OpenGL/Cocoa/UnderlaySurface/
Note that the example, pathetically, does not even work. The problem is
that NSPrincipleClass in UnderlaySurface-Info.plist should be "App" not
"NSApplication"- an easy fix at least.
Also the example code calls:
[[self window] setAlphaValue:.999f]
in viewDidMoveToWindow. This seems to be completely unnecessary.
Lastly, I suggest you search the list archives (all lists) for these key
words "underlay opengl cocoa".
>Thanks for any suggestions you may be able to offer.
Your signature is _longer_ than your message, I suggest you shorten it. :)
--
____________________________________________________________
Sean McBride, B. Eng <email_removed>
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
DATE : Thu Feb 15 16:03:21 2007
On 2007-02-14 16:33, Matt Trinneer said:
>I've been trying to figure this out for a while but am having a
>little trouble, being new to Cocoa, and OO programming in general.
>Here goes: Is it possible to draw Interface Builder controls such as
>buttons, sliders, etc. in an OpenGL view? I've figured out how to
>capture bitmap representations of controls and render those in OpenGL
>space. What I'd like to do is create 2D representations of these
>controls in a 3D OpenGL context, while retaining the ability to
>respond to user inputs using the interface elements built in event
>handling, action, and output functionality . From my reading so far
>OpenGL seems like a suitable candidate for the 3D rendering
>environment. However I can't figure out if there is built-in Cocoa
>functionality to accomplish this, or, if I'd have to build it myself.
I have investigated this recently. As others have said, overlapping
views are in general not advised. You'll want to look at the
"UnderlaySurface" example. It is installed with Xcode here:
/Developer/Examples/OpenGL/Cocoa/UnderlaySurface/
Note that the example, pathetically, does not even work. The problem is
that NSPrincipleClass in UnderlaySurface-Info.plist should be "App" not
"NSApplication"- an easy fix at least.
Also the example code calls:
[[self window] setAlphaValue:.999f]
in viewDidMoveToWindow. This seems to be completely unnecessary.
Lastly, I suggest you search the list archives (all lists) for these key
words "underlay opengl cocoa".
>Thanks for any suggestions you may be able to offer.
Your signature is _longer_ than your message, I suggest you shorten it. :)
--
____________________________________________________________
Sean McBride, B. Eng <email_removed>
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
| Related mails | Author | Date |
|---|---|---|
| Matt Trinneer | Feb 14, 22:33 | |
| Daniel Steward | Feb 14, 23:52 | |
| Scott Anguish | Feb 15, 00:00 | |
| Daniel Steward | Feb 15, 00:21 | |
| Alastair Houghton | Feb 15, 00:51 | |
| Sean McBride | Feb 15, 16:03 |






Cocoa mail archive

