Polygon Triangulation
Feb 8th
If you’re using OpenGL, you may have a need to triangulate your polygons in order to draw them.
A common algorithm to do this is the ear clipping algorithm. We’ve been on the search for a solid implementation of this for a while, and have finally found one:
http://www.flipcode.com/archives/Efficient_Polygon_Triangulation.shtml
It’s written in c++ and has no dependencies (except for stl). It was really easy to use, and worked well in our tests.
Welcome to the new Spiralstorm Blog
Jan 15th
We’ve been so busy lately that we haven’t had any time to share with the world, but have no fear, with the aid of our new, redesigned blog, we’ll finally have a venue to talk about everything Flash, iPhone, and games.
Check back in the upcoming days when we’ll be blogging about what we’ve been up to.
Creating unique variables within your preprocessor macros
Dec 1st
Sometimes in your macros you need to use a variable, but you can’t scope it to the macro. If you use this macro more than one in the same scope you get a duplicate variable warning.
For example, let’s say this is your macro:
#define LOOP_10_TIMES \ int i = 0; \ for( i = 0; i < 10; ++i)
And this is your implementation:
LOOP_10_TIMES{
x += i;
}
This is fine, but what happens when you want to use this macro twice? Like so:
LOOP_10_TIMES num += i; LOOP_10_TIMES mun += i;
You’re sure to get a nasty error (or at least a warning).
This is because your code now declares the variable ‘i’ twice in the same scope.
Calling C functions in your C++ code
Oct 20th
Have you ever wanted to call a c function located in one file within a different c++ (.mm / .cpp) file?
If you did, you probably know that it can be a royal pain if you don’t know the trick.
So if like me you’ve been looking for the solution, it’s very easy! Just use the extern “C” keyword (not to be confused with plain extern). Here’s an example:
extern "C" #include "my_c_code.h";
This also works with the Objective-C #import keyword:
extern "C" #import "MyObjCClass.h";
or alternatively for multiple includes
extern "C" {
#include "my_c_code.h"
#include "my_other_c_code.h"
}
And that’s the way you include someone else’s C code into your C++ files. Easy!
But…
If you’re writing brand new C code and you want it to be automatically compatible with other C++ code you can build it in a way that will make it #include’able into any source file.
Using the __cplusplus preprocessor variable you can check if the current build target is a c++ file and if so, surround your code with extern “C”
So for example let’s say this is our current C header file:
//my_c_header.h: int addOne(int n); int globalVar; //..etc
To make this code C++ friendly, we’d do this:
//my_cpp_friendly_c_header.h:
#ifdef __cplusplus
extern "C" {
#endif
int addOne(int n);
int globalVar;
//..etc
#ifdef __cplusplus
}
#endif
Now in your C++ file you can just write
// my_cpp_code.cpp #include "my_cpp_friendly_c_header.h"
So if you know that your C code will be included into C++ source, it’s always a good idea to wrap it in extern “C” { … } to avoid headaches later on…
More info over at: http://www.parashift.com/c++-faq-lite/mixing-c-and-cpp.html
Woo hoo, It’s out! Get some Flyloop
Jun 27th
It’s been 14 very long days, but Apple finally approved Flyloop. Go check it out, here’s the iTunes Link: Download
And of course, check out http://www.flyloop.com
New game, Flyloop
Jun 14th
It’s been quite a while since we las blogged, but it was for a good reaon!
Well, maybe no reason is good enough but hopefully this makes it excusable.
For the past two months we’ve been working tirelessly on a new game for the iPhone who’s premise is very simple: Catch some butterflies.
We’re getting ready to send it in to Apple so keep your fingers crossed!
Oh, and check out the brand new site we made for it: http://www.flyloopgame.com.
* If you own the domain www.flyloop.com… please stop re-purchasing it soon.
Macworld Reviews Freedom Run
Dec 22nd
Ben Boychuk of Macworld has recently reviewed Freedom Run for the iPhone and dare we say found it entertaining.
Read the full review here: http://www.macworld.com/article/137663/2008/12/freedomrun.html?t=206
Thanks Ben, and forward our apologies to your nephew, we’re working on an update that will correct that bug.
And for the record, everyone should have an iPhone!
Freedom Run is Running Wild!
Nov 29th
It’s been almost two weeks since we’ve released Freedom Run, our first game for the iPhone, and it’s been doing great!
With over 7,000 downloads, Freedom Run is running wild and iPhone users are loving it.
We have seen several issues with some scores not making it to the leaderboard. For those who’ve encountered this issue don’t be dicouraged – just contact us with your email and score and we’ll give you that piece of leaderboard real estate you deserve.
We’re also working on correcting the issue – that, and more will be available in our upcoming update to the game.
Black Friday is here
Nov 26th
In the spirit of the holidays, we’ve decided to temporarily reduce the price of Freedom Run for the iPhone from $0.99 to be completely Free, yes Free!
It’s fun to play, addicting, and now Free. So get it while you can.
Freedom Run is Live! and on the App Store
Nov 17th
Over the weekend, our first iphone game was released.
The game is simple, keep your iphone balanced so the mascots are upright. The furthest you walk the better your chances at making it into the national leaderboard.
Freedom Run is a light and fun casual game that is addicting and fresh. With great graphics and original music, Freedom Run is a great game for the subway ride home, or when the boss is not looking in the office.
From the looks of it users love Freedom Run. Over its first 24 hours the game has gotten several great reviews and has been downloaded over 1,000 times, and counting (We’ll post updated stats by the end of the week)
The game is distributed for free, that’s right, free! but only for a limited time. So go download it, play it, and dont hesitate to leave us a comment or write a review.
We’re planning an update soon, so comments and suggestions are welcome.


