Re: SCNView : setting "overlaySKScene" doesn't render anything
Re: SCNView : setting "overlaySKScene" doesn't render anything
- Subject: Re: SCNView : setting "overlaySKScene" doesn't render anything
- From: Gavin Eadie <email@hidden>
- Date: Fri, 26 Feb 2016 19:11:41 -0500
The intelligence boosting power of posting a question strikes again.
The problem was that in the Mac OS X Storyboard, the "Rendering API" of the
SCNView was initialized to "unknown" when it needed to be "Metal"
(curiously, "OpenGL" and "Default" don't render the overlay either). This
is the "renderingAPI" required property of the SCNRenderer protocol that
SCNView obeys; it's most easily set in IB.
On Fri, Feb 26, 2016 at 5:19 PM, Gavin Eadie <email@hidden> wrote:
> I have struggled long and hard with this .. I think I’ve looked at
> 'everything' related on Google, but I’m still flummoxed.
>
> This is on Mac OS 10.11.3, build with Xcode 7.2, and this is what I think
> is the salient code.
>
> override func viewDidLoad() {
> super.viewDidLoad()
>
> let scene = SCNScene()
> let sceneView = self.view as! SCNView
>
> sceneView.scene = scene
> sceneView.overlaySKScene = OverlayScene(size: sceneView.bounds.
> size)
> sceneView.backgroundColor = NSColor.blackColor()
> sceneView.autoenablesDefaultLighting = true
> sceneView.showsStatistics = true
> }
>
> ('OverlayScene' generates a simple SKScene with some centered text)
>
> On the Mac it works correctly if the window layout is described by a XIB.
> On the Mac it doesn’t show the overlay if the window layout is described
> by a Storyboard.
>
> The XIB and Storyboard are quite different (as is normal), but what in
> there could have this effect?
>
> Any help to resolve this would be appreciated .. I suspect, as is often
> the case, I’m overlooking something obvious .. Thanks
>
> FWIW: This same code works correctly on iOS using a Storyboard.
>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden