Tampilkan postingan dengan label Mac OS X. Tampilkan semua postingan
Tampilkan postingan dengan label Mac OS X. Tampilkan semua postingan

Senin, 21 September 2009

More Desktop Code

Although my focus for the last 20 months has been the iPhone, I've tried to stay at least in touch with Cocoa for the Mac. As a result, I tend to start a lot of small projects designed to help me learn, re-learn, or brush up on some specific area of functionality. A lot of these projects just end up gathering dust on my hard drive and are never used in any kind of production application, so since I'm doing a little housecleaning, I thought I'd post some of these projects that might be useful to iPhone developers wanting to get into Mac development or for newer Mac developers.

I've written several Cocoa applications over the years that work with Quicktime, including Crimson FX, a simple rotoscoping and special effects application. Back when I wrote these, most of the Quicktime functionality had to be accessed through Carbon calls. Since then, there have been several major releases of Quicktime, and Cocoa has gained some very robust Quicktime support by way of QTKit.

To familiarize myself with Cocoa's current Quicktime functionality, I wrote a small application that loads in a Quicktime movie and allows you to step through it frame-by-frame or to scrub through the frames using a slider. There's also a custom view that displays a filmstrip timeline, similar to the way iMovie displays a timeline.



This is neither a full-featured, nor a production-ready application, but if you're interested in writing a Cocoa application that needs to do more with Quicktime than simply play a movie, you may find some of the code in here useful. In addition to the filmstrip view, there's also a category that adds several methods to QTMovie for dealing with the individual frames of a movie's video track.

You can find the project here. As always, there are no restrictions on the use of this code, and I welcome any improvements or bug fixes you might come up with.

Minggu, 20 September 2009

Some Desktop GL Goodies

No time for a tutorial or lengthy description, but I thought I'd quickly post a few Xcode projects I've got.

First is the OpenGL ES icosahedron project from way back in OpenGL ES from the Ground Up, Part 2, only ported to Cocoa for the Mac. This is the very first one, with no lighting. It does show how to set up OpenGL ES on the desktop, including toggling full-screen mode. You can also use the arrow keys to increase or decrease the rotation speed.

Second, I've taken Apple's very old NSOpenGLView Full Screen sample code, and updated it to use the modern approach that works nicely with multiple displays and multiple GPUs. You can find the updated Xcode project here.

Third, here's another version of NSOpenGLView Full Screen sample code that creates a dedicated full screen app that doesn't support a windowed mode.

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Lady Gaga, Salman Khan