Skip to main content
Home Forums 68kMLA Binary recompilation from 68k to OS X - why not? — #2
Post #2 by Emehr
Source Forum68kMLA
CategoryDevelopment
Post DateSat, 8 Sep 2012 - 14:41
Original URLhttps://68kmla.org/bb/threads/binary-recompilation-from-68k-to-os-x-why-not.26170/
Post
The classic Mac OS Toolbox (all of the functions that are Mac OS-specific like drawing to the window, managing files, creating menus, controls, and dialog boxes, etc.) and the Cocoa APIs for Mac OS X are two completely different beasts.

Classic Mac OS applications are deeply interwoven with Toolbox calls and there is no direct one-to-one replacement with Cocoa commands. All of the straight C stuff can be ported with little or no effort, but anytime you want to do anything Mac-specific you have to rethink pretty much everything. Graphics are completely different, for example. In Mac OS, you have to set up your own offscreen "windows" (invisible to the user) so you can make your drawing calls to it then copy it to the screen to avoid flicker. In Mac OS X, double-buffering is handled automatically. You just draw directly to your window.

Not only that, the way Mac OS and Mac OS X handle user and system events is different too. In Mac OS, you have to regularly see what events are in the queue and branch off depending on the event. In Mac OS X, all of that stuff is transparent to the programmer. You basically just have to associate which parts of your interface are associated with what commands.

mp.ls