Custom Patches
From QuartzCompositions.com the central source for Quartz Composer :: wiki
This page is intended to summarize tips and tricks for people who are working on expanding the functionality of quartz composer to add new patches.
How to add new patches
NOTICE!: This information is out of date as of MacOS X 10.5 Leopard and Quartz Composer 3.0, which provides built-in support for custom patches. This page needs to be updated.
Thanks to qcjp for sharing the following directions. They should be a good start if you are interested in joining the effort.
0) Read Apple's "Quartz Composer Programming Guide".
1) Create a cocoa bundle project in Xcode.
2) Implement a principal class similar to QCExtraPatches.
- registerNodesWithManager : fp8 is GFNodeManager*. and you must call registerNodeWithClass to regist your patch class.
3) Implement a patch class similar to QCTeapot.
- executionMode : return 1; // maybe render is 1.
- allowsSubpatches : return NO; //?
- initWithIdentifier : return [super initWithIdentifier:fp8]; //?
- setup : return fp8; //?
- execute : fp8 is QCOpenGLContext*.
you must call CGLSetCurrentContext() before draw GL.
fp12 is time.
you may read and write ports in this method.
See How-to: Write a Custom Patch (http://www.clockskew.com/blog/?p=15) for complete detailed instructions.
Patch Implementation
Examples
- clockskew: How-to: Enable Patches (http://www.clockskew.com/blog/?p=14)
- qcjp: .3DS loader / triangle source code (http://translate.google.com/translate?hl=en&sl=ja&u=http://blog.livedoor.jp/quartzcomposer/archives/29457389.html)
