From: Dan Asimov <dasimov@earthlink.net> Dan, a couple clarifications would help ...
I have a nice iMac Do you mean an Intel iMac? Do you want to o Just use Mac OS , o Throw away Mac OS and run Linux, o Dual-boot Mac OS and Linux (one at a time), o Run Linux under something like virtualbox or Parallels, inside Mac OS? I used to have GL (what gave rise to openGL) under Unix, and could just write a program to do pretty much anything I wanted.
(The key is having the command "Paint pixel (K,L) the color (R,G,B).") I really understand the desire for that operation.
Do you want to o see the individual pixels show up as they are computed, o draw frames and have them flip as you finish each frame, o just see one finished picture when it's done, o produce a picture file in a standard format, o produce an executable for other people to run? I second Mike Stay's endorsement of Processing. It's a simplified dialect of Java. The native form of it has very simple IDE (text editor with a run button, basically) and runs your program locally, or you can export a program as a combination web page and .jar file for the web. Processing's paradigm is that you write a procedure called "draw" that calls functions like draw-a-pixel. Draw gets called n times a second to draw frames. I think the default is that you draw over a copy of the previous frame, so you can incrementally build up a drawing. Processing also has interaction on the model "Is the mouse down, and if so at what x and y?" Do you want to program in o C or C++? o Python o Java o Other? For C, basically all of the APIs for graphics in Unix are available in their standard Unix forms. Mac package managers (for downloading/building/installing standard software) with their repositories of ports are different from the Linux ones. o MacPorts a.k.a. the BSD "port" command. Sponsored by Apple. I use it. o Homebrew. Some people use this for Mac. o Fink. has gone stale. But, when MacPorts doesn't have it, often download/untar/configure/make/make install works. I have not used openGL through C. For Python, there is o the pyglet library to do openGL, o PyProcessing, which is surprisingly similar-seeming to (Java-) processing. o Reportlab pdfgen, I find it very easy to write simple vector graphics with text in it. (Basically the postscript drawing model only you program in Python instead of FORTH.) o PIL, the Python Image Library, for producing image files.
Is that really necessary? After all, there's a form of Linux on the iMac and I'd be happy to program with that. ) From: Jon Ziegler <jonz@alumni.caltech.edu>
No, it isn't necessary. No, there's no Linux on the iMac. The basic thing to keep in mind is that an Intel Mac is just a standard Intel PC. Ordinary Intel Linuxes run on the Mac. As I mentioned above, many people keep Mac OS around also, either by dual-booting or running Linux in some virtualizer.
What's on the iMac is Mac OS X, which is Unix. Officially certified (see here<http://www.opengroup.org/openbrand/register/apple.htm>). Anything that works on a real Unix should work on the Mac. This part is true. For instance, Motif got installed on my Mac just because it was a dependency of some LateX renderer I wanted.
Of course if you want it to run using the Mac's regular user interface, which has nothing to do with Unix, then you'll need to program all sorts of stuff for that. Or use something compatible. But if you're clear about what you want there are good places to ask for help. In a lot of approaches there's some window or GUI system (e.g. Qt or Tk) consciously involved just because your program needs to ask for a window for your graphics to show up in. Likewise if you want to have "Quit" in the menu or handle more interaction. This is true in Linux, too. But it's not true for the native Processing, that is, having a window appear when you run the program just happens.
--Steve