This program is intended as a test of line-drawing speed. It draws a specified number of lines each update. It tries to do 60 updates per second.
It displays the average update rate as "fps" (frames per second). It also displays the average number of lines it could draw per second if it weren't doing anything else. This number is calculated as the number of lines drawn divided by the number of seconds taken by the drawing routine.
download the TestLines executable (PowerPC only at the moment)
download the TestLines project files (licensed under the GPL)
(Requires the Apple Developer Tools - I used XCode version 2.2)
This project illustrates several aspects of programming for Mac OS X using the Cocoa API:
- separate Model, View, and Controller classes
- use of bindings
- drawing lines via BezierPath in an NSView subclass
- use of applicationShouldTerminateAfterLastWindowClosed
- use of NSTimer (to get regular updates)