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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to