• 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
Re: QCView openGLContext
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: QCView openGLContext


  • Subject: Re: QCView openGLContext
  • From: Sam McDonald <email@hidden>
  • Date: Thu, 13 Mar 2008 20:20:37 -0500

With that application I used an NSView, but I was very new to cocoa and only did that because that is what some sample code did. A QCView in 10.4 didn't do a whole lot for you if you aren't using bindings if I remember right. NSView worked fine for use, but now looking at NSOpenGLView, it might have been a better path for us. We did have some issues with rendering it this way, that we finally decided to scrap and just do it in our Leopard release.

And yes firing a timer is exactly what I did, except we did 1/30th of a second because our Quartz file usually stayed at about 30 frames a second.

Sam McDonald
Trimonix

On Mar 13, 2008, at 8:00 PM, Lorenzo wrote:

Thank you Sam,
Your code looks promising. One question, should the renderView be a simple NSView, a QCView or an NSOpenGLView?
If not a QCView, should I fire a timer each 1/60 sec in order to render with renderAtTime into the NSView or OpenGLView?



Best Regards -- Lorenzo email: email@hidden

From: Sam McDonald <email@hidden> Date: Thu, 13 Mar 2008 19:23:35 -0500 To: Lorenzo <email@hidden> Cc: email@hidden Subject: Re: QCView openGLContext


I have programmed cocoa for less than a year, so if I say something stupid please bare with me. Of the programming I have done most of it has been with QC apps. From what I remember the openGLContext was added in 10.5 (and made me very excited).

In my 10.4 application I created a glcontext, set its view, and rendered to it using a QCRenderer. Here is what that looked like, please don't laugh at my ugly code, this is some of the first objective-c I wrote:

//Create OpenGL context used to render the QCRenderers and attach it to the rendering view
NSOpenGLPixelFormatAttribute attributes[] = {NSOpenGLPFAAccelerated, NSOpenGLPFANoRecovery, NSOpenGLPFADoubleBuffer, NSOpenGLPFADepthSize, 24, 0};


glPixelFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes:attributes];
_glContext = [[NSOpenGLContext alloc] initWithFormat:glPixelFormat shareContext:nil];
[_glContext setView:_renderView];


// Create QCRenderers from composition file
compositionPath = [bundle pathForResource:_compositionName ofType:@"qtz"];
renderer = [[QCRenderer alloc] initWithOpenGLContext:_glContext pixelFormat:glPixelFormat file:compositionPath];




This will allows you to flush your buffer, but doesn't produce nearly as nice code as what the 10.5 stuff allows you to do.

Sam McDonald
Trimonix


On Mar 13, 2008, at 6:53 PM, Lorenzo wrote:

Hi,
I build my app against 10.4 SDK. The compiler says that there are no errors.
My app runs on Leopard very well. But on Tiger I get this error all the time
and my app won't launch.
--
[MYQCView openGLContext] : selector not recognized [self = 0x1492fee0]
--


If I comment this line below
[[qcView openGLContext] flushBuffer];
my app launches and runs well, but of course I can't see the QCView contents
properly. I have seen that this API is available in 10.5 and later. Anyway
my compiler doesn't protest when I build my app against 10.4 SDK. This a
part, how can I make this work on Tiger too? Any workaround?



Best Regards -- Lorenzo email: email@hidden

_______________________________________________

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




_______________________________________________

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


References: 
 >Re: QCView openGLContext (From: Lorenzo <email@hidden>)

  • Prev by Date: Re: get currently logging in users
  • Next by Date: Strange retainCount from NSTimer
  • Previous by thread: Re: QCView openGLContext
  • Next by thread: Re: QCView openGLContext
  • Index(es):
    • Date
    • Thread