On Jun 11, 2008, at 12:39 PM, Jens Alfke wrote:

Are all layers treated as bitmap textures, even solid ones? For instance, if I create a 1024x1024 layer as a background and just set its background color to blue, does that allocate a megapixel's worth of VRAM? What about if I add a border or round corners?

Layers only use textures / VRAM for the images or drawn content you provide. None of the other features (background color, border color) use any texture memory. (Colors that are patterns allocate a texture for the single image cell in the pattern, but not for the layer size.)


I've wondered about this with the Grid class in GeekGameBoard, which is used to represent things like chess or Go boards. Is it better to use one big layer with a custom drawing proc that draws the squares, or 64 (or 324) smaller layers?

For small checks a single layer with a pattern-based background color would be best. For large checks multiple layers may be more efficient. The best way to investigate this kind of thing is via the OpenGL Driver Monitor application, you can use it to display the amount of free VRAM over time,

        John


_______________________________________________

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