Previous Blog Next Blog
Prev/Next Blog
by date

FrameTemp template class and COM in Torque

FrameTemp template class and COM in Torque
Name:Pat Wilson
Date Posted:Apr 30, 2005
Rating:Not Rated
Public:YES
Comments:YES
RSS Feed:GarageGames Blog feedor Subscribe with .
Profile Page:View profile page for Pat Wilson

Blog post
Yikes, it's been way over a month since my last .plan. The last one, I think, broke some records as far as the ratio between the length of the .plan and the number of comments.

What have I been up to? Well yesterday Marble Blast Xbox passed Xbox compliance testing and is going on to functional testing. I'm saving the serious celibration until I see the game up for download, but I do have the cover page of the compliance report with "PASS" circled in hi-lighter. With any luck the game will be out on Xbox Live Arcade before our next exciting announcment.

I can't talk at all about what I'm working on right now, unfortunatly, but it is a good thing for GarageGames and a good thing for indies. So instead I'll just ramble on about other things so I don't have a pathetic .plan length. Announcements will be made pretty soon with any luck. Here's a little teaser though...


I've been adding to TDN so that when the doors open on it there will be articles already there. Thismorning I added one on the FrameAllocator, so you all can look forward to that when TDN opens. I also added a new support-class to the FrameAllocator. It's called FrameTemp and it's a templatized class. You use it like this:

FrameTemp<char> foo(32);
dStrcpy( foo, "Foo!" );

Which is the same as doing...

char *foo = new char[32];
dStrcpy( foo, "Foo!" );
delete [] foo;

The cool thing about the FrameTemp class (like the FrameAllocatorMarker) is that it will manage the watermark on the FrameAllocator by using scoping. It's really useful. I added it to support another class I wrote...

The other thing I started working on a bit is called ComConsoleObject. I'm not sure how familiar any of you are with Win32 COM, but it's a TorqueScript wrapper for COM objects. You can actually get an instance of a COM object, list the methods, call methods on it, etc...all from script!! So for example I can type:

new ComConsoleObject( itunes, "{0xDC0C2640,0x1415,0x4644,{0x87,0x5C,0x6F,0x4D,0x76,0x98,0x39,0xBA}}", "{0x9DD6680B,0x3EDC,0x40db,{0xA7,0x71,0xE6,0xFE,0x48,0x32,0xE3,0x4A}}" );
itunes.invokeMethod( "pause" );

And iTunes will pause! It's pretty sweet. (If you are wondering what that huge hex string is, it is the CLSID and IID of the iTunes COM object. Yes it is ugly.) Right now you can't pass arguments to functions (hehe) but I'm going to tinker with it, and maybe at some point you will be able to. Why do this? Why not provide scripters with the ability to tap into something like iTunes in Game Mods? I mean, hell, that's all I wanted to do was control iTunes while inside World of Warcraft. So now, in Torque, after I make it a bit more feature-complete, I could easily make, with 100% scripts, a little GUI window that would control iTunes. How cool is that?

Alright so you may be thinking, "You have too much free time," well, it's true. I got hurt playing soccer and I won't be able to do yoga or soccer or bike or (cry) dance at 80s night for a good long while I think. So until then, though, I'm going to go back to swimming, which I used to compete in when I was little (and not as engulfed by evil) and program silly things, and work on my Ultramarines. Anyway, enough about non tech stuff. If you want more of that you can always visit my blog for the latest in non-GarageGames, and innappropriate things.

Recent Blog Posts
List:08/28/08 - G-Buffer Normals and Trig Lookup Textures
06/17/08 - Multi-Threaded Mesh Skinning Showing Promise
08/14/06 - Torque X and Microsoft
02/11/06 - 10th Most Popular Game on Live
07/13/05 - Development of TSE360
07/03/05 - Where's the beef
06/09/05 - Recovery Time
04/30/05 - FrameTemp template class and COM in Torque

Submit ResourceSubmit your own resources!

Adam deGrandis   (Apr 30, 2005 at 23:42 GMT)
Pat, your blog is quite entertaining. :) Glad you linked to it.

Xavier "eXoDuS" Amado   (Apr 30, 2005 at 23:43 GMT)
Not to mention that COM will only work in windows :)

Chris Newman   (May 01, 2005 at 02:44 GMT)
Your personal blog rocks.
I didnt even know you were that young. (23)

Vashner   (May 02, 2005 at 03:36 GMT)
Great news on the xbox front.

Neil Marshall   (May 02, 2005 at 14:30 GMT)
Yeah the Windows only COM thing sucks. I wonder is mozilla's XPCOM might help you (I have no clue).

Pat Wilson   (May 02, 2005 at 17:46 GMT)
The problem is, I wrote it for iTunes (primarly) and it uses regular COM. I'm not sure what the Mac equivilant is, if there is one. It seems like XPCOM is a bit fringe. I'm really not sure.

Joshua "RegularX" Birk   (May 03, 2005 at 20:12 GMT)
On Macintosh the equivalent iTunes hooks come via AppleScript, I believe. But I think sample code is in some darker corner there to find a decent example of interacting with iTunes.

Valador, Inc.   (May 26, 2005 at 16:10 GMT)
That COM control is right up the alley of something we need to do. Any chance of seeing it as a resource anytime soon, even an incomplete one some of the rest of us could work on?

You must be a member and be logged in to either append comments or rate this resource.