• 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
CAOpenGLLayer
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CAOpenGLLayer


  • Subject: CAOpenGLLayer
  • From: Stefan Hafeneger <email@hidden>
  • Date: Sat, 29 Mar 2008 17:01:20 +0100

Hi,

I would like to use CAOpenGLLayer instead of NSOpenGLView. I didn't find any example source code but got it working. I implemented

- (BOOL)canDrawInCGLContext:(CGLContextObj)glContext pixelFormat: (CGLPixelFormatObj)pixelFormat
- (void)drawInCGLContext:(CGLContextObj)glContext pixelFormat: (CGLPixelFormatObj)pixelFormat forLayerTime: (CFTimeInterval)timeInterval displayTime:(const CVTimeStamp *)timeStamp
- (CGLPixelFormatObj)copyCGLPixelFormatForDisplayMask:(uint32_t)mask
- (void)releaseCGLPixelFormat:(CGLPixelFormatObj)pixelFormat


The API documentation says that the viewport is already set to bounds size before drawInCGLContext:... is called and that I should disable all OpenGL settings that I enabled before. I don't understand why.

I would like to setup my OpenGL context once (as with NSOpenGLView) and set the perspective only if the bounds change. I tried to set the perspective (gluPerspective) in copyCGLContextForPixelFormat:... but this didn't work (I set the currect context to the new OpenGL context and also locked the context).

So, is there a way to setup the context once and update the camera only when needed or do I have to setup the environment in every drawInCGLContext:... call?

With best wishes, Stefan Hafeneger
_______________________________________________

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: CAOpenGLLayer
      • From: John Harper <email@hidden>
  • Prev by Date: Re: NSScroller question
  • Next by Date: Re: GDB says not an object
  • Previous by thread: Re: how to check if a property is empty?
  • Next by thread: Re: CAOpenGLLayer
  • Index(es):
    • Date
    • Thread