Re: Request for guidance re. CALayer
Re: Request for guidance re. CALayer
- Subject: Re: Request for guidance re. CALayer
- From: Richard Charles <email@hidden>
- Date: Wed, 07 Jan 2015 11:22:03 -0700
> On Jan 7, 2015, at 8:02 AM, Luc Van Bogaert <email@hidden> wrote:
>
> For instance, I have already been able to create and add sublayers to a layer-backed view, but it is still unclear to me how to draw graphic content in these layers.
I would start by drawing something to a single layer. You can draw using CALayer or CAOpenGLLayer. Use one of Apple’s sample code projects to get yourself up and running.
When using CALayer, subclass and override drawInContext: to draw something.
When using CAOpenGLLayer it is more difficult but basically you subclass and override drawInCGLContext:pixelFormat:forLayerTime:displayTime: to draw something.
For a “drawing application” you would most likely have a multitude of model objects drawn using a single layer.
Richard Charles
_______________________________________________
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