• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Layer-backed NSOpenGLView not showing up
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Layer-backed NSOpenGLView not showing up


  • Subject: Layer-backed NSOpenGLView not showing up
  • From: Albert Martin <email@hidden>
  • Date: Fri, 3 Oct 2008 12:46:46 -0400

Hello,

I am trying to programmatically create an NSOpenGLView and have it layer-backed. I would use CAOpenGLLayer except that I am using a subclass of NSOpenGLView and I don't have the time to rewrite it. Now, for some reason I can not get the NSOpenGLView to show up. If I use the same subclassed NSOpenGLView in Interface Builder everything shows up fine and I can communicate with it how I need to, but if I create it programmatically it simply never shows up.

The weird thing is that I think it is getting created correctly but is just not becoming visible. The NSOpenGLView plays a QTMovie and even though it doesn't show up I can still hear the audio from the QTMovie playing back. Also, I've added a bunch of NSLog's in the subclass and they all get triggered when I try to communicate with the version that was created programmatically even though it never shows up.

Here's my code ... what am I doing wrong?

videoLayer = [[CALayer layer] retain];

NSOpenGLPixelFormatAttribute attributes[] = {
NSOpenGLPFANoRecovery,

NSOpenGLPFAColorSize, 24,
NSOpenGLPFAAlphaSize, 8,
NSOpenGLPFADepthSize, 16,
NSOpenGLPFADoubleBuffer,
NSOpenGLPFAAccelerated,
0};

presentationVideoLayer = [[[IWVideoView alloc] initWithFrame: NSMakeRect(0, 0, frameRect.size.width, frameRect.size.height) pixelFormat: [[NSOpenGLPixelFormat alloc] initWithAttributes:attributes]] retain];
[presentationVideoLayer setLayer: videoLayer];
[presentationVideoLayer setWantsLayer: YES];

[[self layer] addSublayer: videoLayer];

[presentationVideoLayer setNeedsDisplay: YES];
[[presentationVideoLayer openGLContext] update];
_______________________________________________


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


  • Follow-Ups:
    • Re: Layer-backed NSOpenGLView not showing up
      • From: David Duncan <email@hidden>
    • Re: Layer-backed NSOpenGLView not showing up
      • From: Matt Long <email@hidden>
  • Prev by Date: NSOutlineView setDoubleAction: working on 10.5, but not on 10.4.11
  • Next by Date: Re: NSOutlineView setDoubleAction: working on 10.5, but not on 10.4.11
  • Previous by thread: Re: NSOutlineView setDoubleAction: working on 10.5, but not on 10.4.11
  • Next by thread: Re: Layer-backed NSOpenGLView not showing up
  • Index(es):
    • Date
    • Thread