app icon

Download

System Requirements

Comments

TinySim

TinySim is a small app exploring various aspects of the OS X graphics system. I documented in my technical log the various API I was using while I was implementing it.

The first post was about basic CoreGraphics drawing: line and shape drawing, a bit of path handling, the recently added and powerful layer abstraction, and general Quartz discussion.

The second episode was about graphics contexts in CoreGraphics. The PDF context is an important one, as the Quartz drawing model is directly inspired by PDF. This post described how to easily generate PDF data (post updated to include PDF rendering).

The third part was again about graphics contexts, with the example of the more experimental Quartz GLContext.

The fourth post showed how to integrate CoreGraphics with another graphic system: OpenGL. In the code example, the CoreGraphics rendering is drawn on an offscreen bitmap context, and then uploaded as a texture in OpenGL.

The fifth post is also GPU-oriented, but stays in OS X API, with a bitmap rendering used as an image on which a realtime GPU zoom/blur effect is applied, through the Core Image framework.

A word of warning

As I'm using CoreImage and CGLayer, this application is 10.4 only, although the source code is probably still interesting for the PDF, GLContext and raw CoreGraphics snippets for older systems. Note also that the Core Image, OpenGL, or GLContext might give bogus results on some graphic cards, as I'm playing with unusually big textures (I tested with a GeForce6800 - I know there are issues with a 4MX for instance, and it won't work with a Rage128). These examples are provided on an as-is basis, so use at your own risk. In some cases, the code has been simplified to be a better example, and is probably not of production quality. Please let me know if you find this useful or if you spot any error or omission!