Merlin's
Tower
Bill Catambay, Pascal Programmer
![]()
Source for
Mac OS X
Below are some complete Pascal projects, including source code, resources, project file and running application. This source code is provided as-is, free of charge. If you have short questions about any of this code, you may e-mail the author, but please do not expect a tutorial on how to program.
Source Code Package Highlights New Skel, by Ingemar Ragnemalm
- Carbon events
- NIBs
- Menus
- Basic event typesAPI Wars, by Ingemar Ragnemalm
- Graphics
- Loading images from files
- QuickDraw
- iSee Videots, by Christian Franz
- Posted: 1-30-07
This is a small sample program that demonstrates accessing your iSight through the SequenceGrabber, and how to apply some video effects in real-time. Includes sample app that requires a video camera, as well as source code.- Carbon events
- Sequence grabbing
- Video effects
- Grayscale
- Edge detection
- HISimpleList, by Gale Paeper
- Posted: 9-01-06
Pascal conversion of Apple's HISimpleList sample code. Shows how to use HIView related APIs to implement CarbonEvents based custom controls. Demonstrates using CFMLateImport sample code as an alternate method for calling CoreGraphics routines in a PPC CFM project without Mach-O function pointer hassles. Updated for compiling with Mac OS X Pascal Interfaces Version G and common source code building with CodeWarrior Pascal and GNU Pascal compilers. Includes projects for CW Pro 8.3 CW Pascal building, CW Pro 8.3 GNU Pascal plugin building, and Xcode 2.x GNU Pascal Xcode integration Kit building.- HIView Custom
- Controls
- CoreGraphics Drawing
- CarbonEvents
- Event Handling
- OpenAL Demo, by Christian Franz
- Posted: 8-13-06
This demo is based loosely on Apple's Objective C OpenAL Demo, and sports four audio sources and one listener. Click with your mouse to re-position the listener. It includes the source code, application, and package bundle containing resources.- Carbon events
- Sound playing
- 2D sound positioning
- Resources from bundles
- Quartz Demo, by Christian Franz
- Posted: 4-30-06
Demonstrates use of mixed QuickDraw and CoreGraphics. Also shows how to use Rotation, Blend Modes, Transparency, and mirroring an image. This XCode 2.1 demo project contains source code written in Free Pascal to demonstrate simple use of CoreGraphics in a Window along with QuickDraw.- QuickDraw
- CoreGrahics
- Image Rotation
- Image Blend Modes
- Image Transparencies
- CTRL Demo, by Christian Franz
- Posted: 11-30-05
Demo application that installs two custom controls into a window and shows you how to handle direct control clicks and commands sent by the control. When you click into the control, you will be presented with a color picker. After picking a color, the control will send a command to your application.- Carbon Custom Controls
- Carbon Event Handlers for windows and Applications
- Carbon Commands
- GWorld Demos, by Ranko Bojanic
- Posted: 10-2-05
This project uses GWorld mappings and linear interpolations between starting and ending colors (click on colored rectangles in bottom right corner to get new random starting and ending colors or use color picker to select these colors). Click on 'Copy from GWorld' button to see a gradual transition from one color into the other. Includes source code, executable, and CW Pro 7 project files.- GWorld mappings
- Linear interpolations of colors
- Makevc, by Willett Kempton
- Posted: 4-17-05
Makevc is a Pascal program to make vCards, and is useful for converting a contact list or address book from an older program. Makevc does a good deal of recognizing (e.g., pulling street, PO Box, zip, country, etc., out of a unitary, undifferentiated address field. This project was compiled with GPC and Dr. Pascal, and includes source and executable (runs in Terminal mode on OS X and DOS mode on Windows).- GPC Pascal example
- Creates vCards
- Interprets unitary, undifferentiated fields
- RandomWalks, by F.C. Kuechmann
- Posted: 2-15-05
This is a sample Pascal project that uses the GNU Pascal plug-in for CW Studio 8. This program displays a window with random walk paths drawn on screen, and includes source code, project, and executable.- GNU Pascal plug-in
- Event Handling
- Graphics drawing
- Collision detection
- Game of Life, by F.C. Kuechmann
- Posted: 2-15-05
This is a sample Pascal project that uses Codewarrior Pro 8 with Metrowerks Pascal. This program is a Pascal version of Conway's "Game of Life", and includes source code, project, and executable.- CW Pro 8
- Event Handling
- Graphics drawing
- Game of Life simulation
- HIToolbar Pascal, by Ryan Joseph
- Posted: 12-10-04
This is a unit and library that supports the port of HIToolbar to Pascal.- HIToolbox functions
- Call Mach-O Samples, by Adriaan van Os
- Posted: 7-20-04
Samples that show how to call Mac OS X routines that are not in Carbon (Codewarrior and GNU Pascal), and how to write a Mac OS X framework in GNU Pascal (including integration with Codewarrior). Includes source code and project files.- Mach-O Calls
- GNU Pascal
- Codewarrior GNU integration
- Object Array Defs, by James Derrick
- Posted: 7-17-04
In response to the recent query about arrays, here is a library which manages arrays of various sorts, including arrays of objects, and also has facilities for performing FFTs and plotting data. It includes the source code and project file.- Array handling
- FFTs
- Data plotting
- Bubul, by Jean-Claude Jesior
- Updated: 6-24-04
This sample is mainly an illustration of the use of CopyBits in Carbon. It also shows how to handle movable dialogs and how to set their font. Project has been compiled with CodeWarrior 8.3 in Mac OS 10.3.2, and includes source code, project files, and executables for both OS 9 and OS X.- Carbon Copybits
- Movable dialogs
- Setting fonts in buttons and static text
- OGL Hovertank, by Christian Franz
- Posted: 3-4-03
Shows how to use OpenGL camera, and some 3D movement transformations. Also shows some basic vehicle effects such as acceleration, inertia, and friction. Includes project file, executable and source (requires OpenGL libraries).- OpenGL calls
- OpenGL camera
- OpenGL 3D movements
- Vehicle effects
- GrabBag, by David Bainbridge
- Posted: 7-31-02
This project contains the Pascal converted code for the GrabBag sample found in the CarbonLib 1.6 GM SDK. This conversion is not from Apple but from myself as an indepent contractor to help any Pascal programmers take full advantage of Carbon.- CarbonEvents
- Sheets & Alerts
- Event Handlers
- Nib's
- Preferences
- Help book
- TESample, by Bill Catambay
- Posted: 11-28-01
This is the original TESample code that Apple created for the 68K machine. It has been drastically changed to work under Carbon.- Event driven
- Resizable Window
- Text Edit
- Traffic Lights, by Ranko Bojanic
- Posted: 11-28-01
Simple Carbon app which displays red and green lights in a resizable window.- Event driven
- Resizable Window
- Battle Sea, by Matteo Varisco
- Posted: 10-10-01
This page describes the game Battle Sea, a game similar to the board game Battleship, and provides the Pascal source code, a project file and a running application.- Board Game
- Event driven
- Windows & Dialogs
- Game graphics
- Game AI
- Coin RAEL, by Matteo Varisco
- Posted: 9-26-01
This is a CodeWarrior Pro 4 project showing how to create a game in Pascal using the Carbon environment (it works with MacOS 9.0.4, 9.1 and 10.0.4). Includes source code, project file, and classic OS 9 executable.- Board Game
- Event driven
- Windows & Dialogs
- Multiple Undos
- Offscreen drawing
- Game graphics
- BasicAppCarbon, by Ron Drake
- Posted: 9-21-00
This is a basic shell program simply to demonstrate a carbonized Pascal project.- Menus
- AppleEvents