CAOpenGLLayer
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