GlkTerm

GlkTerm is a simple application designed to help with writing glk client applications. Download this if you want to write a new IF interpreter on OS X, or if you want to port an existing one.

GlkTerm uses the CocoaGlk library to provide a client interface for developing Glk applications. This allows you to develop a Glk application using XCode or the command line and run it immediately.

I'm going to write some more about developing glk applications for CocoaGlk, but to get started, you'll need to link to GlkClient framework (included in the download). You will also need to modify your glk source code a bit, and write a main function.

Instead of just including glk.h, you should include the glk.h file for CocoaGlk using:

You might also add a glk.h file to your project including just that line if you don't want to edit your sources. This is required because of the way frameworks work on OS X.

CocoaGlk doesn't provide a main function, as it is not possible to have a main function in a shared library in OS X, so you'll need to add this yourself. Unless you're doing something really unusual, this will always be the same:

{[.glk-main /enzymes/chili-cplusplus.php]}```

If you just want to play with GlkTerm, the version of glulxe included with Zoom may be a good starting point. Use the Finder to display the contents of the Zoom package, then navigate to the Glulxe plugin, and display the contents of that to find the client executable. The easiest way to get it to run is to launch GlkTerm and then drag the glulxe-client file to a terminal window.