Managed World

Techno-babble from yet another babbler RSS 2.0
# Wednesday, July 06, 2005

[Update: I added the assets directory to the source zip and re-uploaded so y'all should have everything you need to actually compile and run the code.]

Well, the rudimentary scene graph is done and hooked into Tanks! Below is a quick and dirty screenshot (remember this is still programmer art).

I was asked the other day if I was going to release source code and I figure, what the hell. Just keep in mind that this is FAR from being a finished product (hell, it's even FAR from being any kind of product at all). So, if you are interested in seeing the source code (albeit totally undocumented source code), you can download it from here. SOOOO, don't even try to ask for documentation because there's no way you're getting it until the articles are written :).

 #       Comments [3]
# Tuesday, July 05, 2005
Mykre recently sent out a reminder that there is an IRC channel for Managed DirectX on EFNet. So, if you want to come around some time, feel free to (it seems like it is pretty quiet (hopefully we can change that)). I'm on there, Mykre is on there, Tom Miller hangs out there (although I hear he's pretty silent), and ZMan says that he'll start checking it out. So, grab an IRC client and head on over anytime (I personally use ChatZilla for FireFox).
 #       Comments [0]
# Monday, July 04, 2005

When an exception occurs while running the sample framework, even if it is handled in a global exception try-catch block, the sample framework will throw an unhandled exception on Dispose. To replicate this issue, simply open up the empty project template and change line 238 in EmptyProject.cs from:

effect.SetValue("appTime", (float)appTime);

to (in order to force an exception):

effect.SetValue("appTm", (float)appTime);

Although it perhaps is not the best fix, the quick and dirty fix for this is to change lines 3948-3957 in the Dispose method in Common\dxmut.cs from:

if (Window != null)
{
// If we have a window, use BeginInvoke to start shutdown
Window.BeginInvoke(new DisposeDelegate(this.Shutdown));
}
else
{
// Otherwise, call it directly
Shutdown();
}

to just:

Shutdown();

Happy Programming!

 #       Comments [2]

I'm posting this as a reminder (for me and for others who were curious about this issue). If you are getting an exception when trying to retrieve transforms from your device (like "Matrix view = Device.Transform.View"), it might very well be because you are using a pure device. Pure devices do not support the getting of these matrices (and this is documented in the docs too evidently).

Happy Programming!

 #       Comments [0]

There is a bug in the sample framework ResourceCache where if you create more than a single font using the method call ResourceCache.GetInstance().CreateFont(), even if they are different fonts, the call will fail the majority of the time. It appears this happens because the key for the Hashtable used in the ResourceCache is the FontDescription structure itself and the FontDescription does not override the GetHashCode() method from object (resulting in differing FontDescription instances actually returning the same hashcode).

So, because of how the method determines whether the font has already been added (it doesn't use .ContainsKey()), the call will fail when the attempt is made to actually add the second font to the hashtable because the key already exists.

If you wish to replicate this, simply use the empty project template and add another line of code after the setting of statsFont to re-initialize statsFont again to a different font.

There is a quick workaround for this. Since the sample framework is just source code, you can actually just calculate the hashcode for the structure yourself and use your calculated hashcode for the key (and don't go through GetHashCode). At least it's a workaround until it is fixed in the framework (which is probably a pretty darn low priority since it is just the sample framework).

 #       Comments [0]
# Sunday, July 03, 2005

Well, I was able to almost finish the core of the new game engine for BooM. Starting tomorrow, I start hard core work on the scene management system, and then on to the game. Here’s a screenshot of the latest version of the engine up and running. This screenshot captures the default look of the game engine. All the components you see are built into the engine. To create a BooM game, you just need to inherit from a couple of classes and do your thing. Theoretically, it should be possible to write any type of game on this engine, whether it be 3d, 2d, text-based, or what have you. However, I guess we’ll see soon how well it goes.

 #       Comments [2]

Contact

Email Me Send mail to the author(s)

Calendar

<July 2005>
SunMonTueWedThuFriSat
262728293012
3456789
10111213141516
17181920212223
24252627282930
31123456

About this site

Jason Olson's thoughts on Programming, Games, Music and Life in General

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2008
Jason Olson

Sign In
All Content © 2008, Jason Olson
Theme based on 'Business' created by Christoph De Baene (delarou)