Apple Developer Connection
Advanced Search
Member Login Log In | Not a Member? Contact ADC

X-Plane's Mac OS X Weapon: Platform Independent Development

For Austin Myers, President of Laminar Research, choosing to develop first on the Macintosh allows his X-Plane flight simulator program to be virtually platform-independent, able to move effortlessly from development on Mac OS X to deployment on both Macintosh and Windows platforms.

”Mac OS X allows me a great choice of technologies,” Austin says, “and the ability to take advantage of them exactly the way I need to.”



Ready for Takeoff

X-Plane is a realistic and highly detailed flight simulator that runs on Mac OS 9, Mac OS X, and Windows. It predicts how planes will fly so pilots can practice with planes they’ve not flown before. Essentially, the product is an extremely detailed flight model that breaks a plane up into its component parts then adds up the force on each part to get the total force on the plane. With X-Plane, pilots receive a realistic experience of how a particular plane handles, making initial flights much safer.

In addition, companies can “load” a plane under development into X-Plane and find out how it will fly even before it is built, making engineering faster and easier. The application accepts, via point and click, the wingspan, weight, power, wing width and other technical variables and then predicts how the plane will fly.

“It’s critical that I am able to write a program that follows the laws of physics first,” Austin says, “and not have to worry about platform dependence. I want my program to work on more than one operating system without the operating system changing it in any way.”

The X-Plane code base works on both Macintosh and Windows primarily because it is written in C++ and both systems use C compilers. The graphics interface for X-Plane is written in OpenGL, the industry standard for developing portable three-dimensional (3D) graphics applications. X-Plane is written using the Mac OS X Carbon application environment; the software was originally developed on Mac OS 9 and then adapted for Mac OS X.

Mac OS X Makes a Difference

Austin made the switch to Mac OS X early. “It was a smooth transition,” he explains. “Mac OS X is great. It’s fast, easy to use, and virtually crash-proof which saves an enormous amount of time when I am writing code.” And best of all, it made development of X-Plane for multiple platforms easier.

X-Plane is developed in Mac OS X and then ported to Windows. After writing the program in Mac OS X, Austin then copies the source code to Windows and recompiles. The changes he makes for the move to the PC amount to less than 5% of the total program code; the only things that need tweaking are the joystick inputs, the sound creation, and the Internet connections.

“The ease of use with Mac OS X is great,” he says. “I spend much less time now working with control panels and extensions, and that has really lowered my set up time and helped streamline application development.”

“Today, X-Plane is written and developed on the Macintosh, as it has been since day one, and ported to Windows to allow cross-platform sales and distribution,” explains Austin. “Engineers at Velocity, NASA, and now Carter-Copter use X-Plane to do design evaluation and simulated flight testing. Eight year olds try their own designs in X-Plane and countless kids gleefully crash their simulated F-22s into the ground at Mach-2. But most X-Plane customers are pilots.”

Industry-Standard OpenGL

The basic version of X-Plane includes plenty of scenery, different airports, and assorted aircraft models ranging from standard single-engine prop models to a variety of military aircraft and rotorcraft, including planes like the Boeing 747-400. With additional scenery CD packs, users are able to fly anywhere in the world as well as over the surface of Mars.

All of this detail requires huge programming capacity and exceptional graphics capabilities. “Back in 1994,” Austin notes, “CPUs had a hard time handling all the calculations. Today, it’s not a problem.”

“OpenGL is the graphics technology that is fast and lean enough to use in a flight simulator,” says Austin. “It really is what has made X-Plane possible, especially the fact that it is fast, close to the metal for speed, and cross platform. Its multi-texturing, display lists, programmable vertices, 3D fog and textures, and hardware lighting are all great as well, and are the things that can turn an average simulation into a great simulation.”

Mac OS X includes Apple’s highly optimized implementation of OpenGL as the system API and library for 3D graphics.

Necessity Breeds Invention

Austin is himself a private pilot with about 650 hours in a handful of light and medium Cessna and Piper singles. After getting his initial instrument rating in South Carolina, he moved to San Diego working for a small aerospace tech company.

“In 1988 I took an instrument currency flight to keep my Instrument Flight Rules (IFR) skills up and had a very difficult time getting up to speed in the crowded, fast-paced air traffic control system of San Diego. After taking three or four flights to get my IFR skills up to speed, I decided that I wanted an instrument trainer for my computer. Microsoft Flight Simulator was then running on the Macintosh, but there were things I wanted done differently so I decided to create my own. I called it Archer-II IFR and used it to keep my instrument skills current.”

While getting his engineering degree, Austin refined his program to be able to simulate almost any airplane imaginable simply by plugging in the blueprints for that airplane and letting the simulator figure out how the plane should fly based on those blueprints. “I used it to test various aircraft designs I conceived — they were all too difficult to fly safely — and renamed the program X-Plane in honor of the series of aircraft tested in the 1960s at Edwards Air Force Base, tests that continue today.”

X-Plane continues to thrive with its Mac OS X foundation, and Austin has added yet another Mac-developed, multi-platform product to his list: Space Combat, a space flight simulator that obeys all the laws of physics.

For more information about Laminar Research and their products, visit the website at www.laminarresearch.com.


“I want my program to work on more than one operating system without the operating system changing it in any way.”