Tuesday, October 25, 2011

Progress report

There isn't really anything new to see yet, but a lot is going on under the hood, so I figured I would make a post. The cross-platform GUI is working out (I already have an Android port), and in addition there are several useful features that were conspicuously absent from the last release (such as independent line and fill colors, paint bucket and layers).

Tuesday, October 18, 2011

Aha! Object-oriented programming!

Well, I didn't intend to rewrite any of the internals of Swift, only the GUI interface. However, now I see that I should have been using objects all along instead of nested dictionaries. The rewrite makes it vastly easier to use. Consider this snippet:
This now becomes:
A bit more concise.

Monday, October 17, 2011

New system almost complete - much more stable

I have mostly finished the framework underlying the second release of SWIFT. I have made a wrapper around most of the windowing functions I need, plus drawing functions which are now handled by the GUI library (which should allow me to make a Clutter backend as well!).  Instead of using the buggy pixel-based hitTest I was using before, I am now using the even-odd algorithm. I was initially calculating exact intersections of lines, but I stumbled across this post, which appears to be much more efficient. Early tests indicate that it is. I ran a benchmark; here are the results (from an Asus EeePC netbook!):
10,000 hitTests
total time: 1.735355 seconds
average time: 0.000174 seconds/hitTest
In other words, that's about 0.1 milliseconds per hitTest! This is better than I expected by a factor of 10 or more! And it all "just works", unlike the pixel version which was very finicky. So (judging by hitTests alone) you could be working with 1,000 objects on the Stage and not even notice a slowdown on a low-spec'd computer!
I will re-write the HTML5 hitTest library to use this algorithm, it should speed it up quite a lot.

Thursday, October 13, 2011

Re-writing SWIFT from the ground up

Most of my problems with SWIFT come from the interaction with PyGTK and Cairo. These are also my major source of pain in platform ports. So I have decided to abstract the GUI library so I can use GTK on Linux, Cocoa on OSX and whatever on Windows. This also lets me fix all the crude hacks I did to get input to the right place. However, this will mean a nearly full re-write of SWIFT (only the object processing functions can stay untouched). Time to get cracking.

Tuesday, October 11, 2011

OSX Working!

I finally got it running on Mac OSX! It is not a one-click setup, and Gnash doesn't run, but it is a start. I will keep working on it and hopefully I can offer a package soon. For installation instructions, see http://swift-swf.blogspot.com/p/installation.html.

Sunday, October 9, 2011

OSX difficulties

Well, I expected it would be fairly simple to get this up and running on Mac OSX, as it is "just another Unix", after all. It turns out I'm wrong. I managed to get all of the dependencies installed, and it loads, but then immediately crashes with the message "Bus error". I will work on fixing this; in the meantime, it could be run in Virtualbox or something.

Alpha release coming tonight!

After a year and a half, the alpha release is coming tonight! Being alpha, not all features are implemented yet, and some are still buggy. But it is finally here!

Download .deb for Ubuntu from: https://launchpad.net/~skykooler/+archive/swift-swf