10 posts tagged “managed directx”
I'm at the Salt Lake Coffee Break again tonight. A 16oz iced mocha, my XML/XSLT book, and I'm ready. I have to transform an HTML page using XSLT by 10am this morning. Better get crackin.
As far as Ingen goes, I'm reworking a lot of it to be built around the beauty that is XNA. Matt and I are working together (finally) on a project in game dev. The requirements are that it's a 2d game in DirectX. We have one week. I promise good things :).
Class is over in 9 days. Wow, this term has gone by fast.
Success! My first functional game built within Ingen is complete! It also sucks balls, but that's not the point. It proves that my engine is capable of doing cool stuff. That first screen is way too pretty to be the splash screen for the game behind it but meh, it looks sweet. You can download it here. Note that the game requires DirectX 9.0c and the .NET Framework 2.0 to run.
Now to make a game that doesn't suck...
Yea, I sorta forgot to post for a couple days. It's been a crazy week.
School is going okay. I've been spending a lot of time figuring out what I'm doing next quarter, especially for projects. Eve Andersson turned down my Managed DirectX project proposal, so that's out. At this point I'm either working on a business model thing with Tony Morgan or NUCentral for another term.
My response? I'm going to try to contact every game developer I can get ahold of to try to set up an Enterprise Projects relationship. That way, I get to continue working on something related to Ingen, and obtain some valuable experience in the games industry while still persuing my CS degree. Pretty cool, eh? that is, if I can pull it off. The top of my list has names like Valve Software, and the XNA team from Microsoft. Wel'll see what I can come up with.
Speaking of XNA, the beta framework is out in a few days. It will hit within a day or three of my birthday. It's like Microsoft decided that my birthmonth was a good time to be more awesome than ever before. Ha, if you'd told me a few years ago that I would be the one to write that sentance, I'd slap you.
This is a bit of a late update, since this was resolved on Saturday, but whatever, it's still good news.
DirectInput finally works. As it turns out, there was no threading issue, just bad code on the part of the Managed DirectX book I was using. The damn thing was getting stuck in an infinite loop and preventing anything from happeneing once the keyboard's Initialize method was run. It now works beautifully, so I can get working on mouselook for the assignment.
It is mildly disheartening that most of the others in the class (well, those that still care. Quite a few people considered the class too difficult and have dropped or become zombies) are fairly close to completing tonights assignment. That is because they're focused on making it work rather than making it a truely object-oriented deal. Oh well, it's worth it.
Salisbury Steak, corn, mashed potatoes, a chicken pot pie, a can of Dr. Pepper, and some Smash Bros. Not a bad lunch.
Looks like I'll be spending most of the night catching up on my XML class. Way too much time working on Ingen, heh. There's a quiz tomorrow that I need to be prepped for. There's a J2EE exam next Tuesday, too. Gah, I need to get working on the lab for that.
Other than that, though, things are good. Matt and I are working on a new project, which is looking promising. I'm working on the DirectInput portion of Ingen. This has made me realize just how badly I need to add events for everything. I'll probably be spending a good deal of Friday doing so.
I decided last night that I wanted to prepare myself a meal for change. Though my schedule doesn't usually allow for the extravegance of...making Pasta Roni on my own time, yesterday was a different story.
I came home with enough Banquet tv dinners and pot pies to fill half of the freezer. TV dinners for a buck and pot pies for $0.43 is pretty hard to pass up. I am enjoying a lunch of beef enchiladas, rice, a pot pie, and a can of Dr. Pepper for the grand total of $2.04. Not bad, considering lunch usually costs me more than five.
Ingen is coming along nicely. Turns out that aspect ratio problem was actually an issue with the mesh itself. Whoever made it used a crappy .X exporter. The following errors occur when loaded in the .X viewer:
In other words, the mesh is missing some of what makes it render properly. The .X viewer is capable of calculating fixes for it, which Ingen does not do. If I see more of these flawed .X exports, I'll add the functionality to do the same, but for now I'd rather focus on implementing DirectInput :) and lighting.Loading model - C:\Documents and Settings\ddahl\My Documents\Visual Studio 2005\Projects\dusda\trunk\Ingen\UI\bin\Debug\samus.x
Tangents and Binormals cannot be generated without a 2-element or greater texture coordinate at TEXCOORD0. Please use DXOps to UV-Atlas your mesh.
Binormals do not exist on mesh. Attempting to calculate.
Tangents do not exist on mesh. Attempting to calculate.
Especially the lighting. Managed DirectX handles lighting with a 'Lights' object array within the Device object. A total of 255 lights may be assigned per Device object, which is plenty (nobody uses that many lights at once). I decided that it would be best to treat the Lights array as exactly that, an array. I'll write a nice layer on top of it that manages adding, removing, and configuring of all lights. Once that's done I'll be able to manage lights in a Scene object (building it to abstract stuff away from the SceneManager, which currently contains code for both running the engine and handling scenes).
But enough mumbo jumbo. My chicken pot pie awaits.
Problems. Always with the problems!
I'm not sure what's causing this, yet. I set my camera up via a CameraInformation object I made. Here are it's properties:
cameraInfo.FieldOfView = (float)Math.PI / 4;
cameraInfo.AspectRatio = 4/3;
cameraInfo.FrustumNearPlane = 1;
cameraInfo.FrustumFarPlane = 1000;
cameraInfo.Location = new Vector3(0, 0, 2);
cameraInfo.Target = new Vector3();
cameraInfo.UpDirection = new Vector3(0, 1, 0);
I've tried modifying the aspect ratio a couple times, but it doesn't seem to be the problem. The field of view isn't an issue either. What the crap?
Now is a time for celebration. I finally hit the "Hello World" of my graphics engine. Thanks to some help from Cybie, the structure is more well defined and, now, completely functional.
I know it doesn't look like much; there is no lighting yet (that's next), but you're looking at a mesh imported from Bryce 5. It has a simple texture on it, which you can't see (again, the lighting), but it's there!
Next up: A more impressive picture.
I just hit a wall in my graphics engine (Hereafter referred to as Ingen).
LoaderLock was detected
Message: DLL 'C:\WINDOWS\assembly\GAC\...\Microsoft.DirectX.Direct3D.dll' is attempting managed execution inside OS Loader lock. Do not attempt to run managed code inside a DllMain or image initialization function since doing so can cause the application to hang.
That's a first. I've never seen this before! This was delivered by something called an MDA...
Turns out the MDA is the Managed Debugging Assistant, which works with the CLR to catch things that can't otherwise be captured. I think I can just get around this by disabling the MDA...but it's telling me that there are potential deadlocks here, so I need to find out why.
So, I looked into the MSDN entry about LoaderLocks. Didn't help much. According to the entry, these are caused by mixing managed and unmanaged code in the same dll...but I'm not using unmanaged code. The SDK may be, but I'm using strictly managed stuff.
More on this when I figure out what's going on.
Solution: Turns out it's just a conflict with DX library versions. From Sontek:
I had this problem awhile ago when I was making my snakes game. The problem is that the libraries you are using are the DirectX 1.1 libraries, You need to add references to the 2.0 libraries or just turn LoaderLock off via the debug menu...Debug -> Exceptions -> Managed Debugging Assistants and uncheck LoaderLock.
Well, glad that's figured out. Now to fix the NullReferenceException that just came up...
Ah, a new week. I didn't get to sleep till about 3am, so I'm not exactly starting off fresh. Oh well.
I've been working on the graphics engine for CS312 (my game development course) for a couple weeks now, but from the repository, you wouldn't guess so. It's been re-written three times now, and now it's just a bunch of class stubs. Bah, doesn't matter. Still, it is frustrating that I currently have a zero in the class because I didn't turn in the cube screensaver assignment...yet I know more about the Managed DirectX SDK than 80% of the people here. Almost everyone else just did a bunch of crappy procedural code in the same class as their form; just to get it done, you know?
Anyway, today's going to pretty much consist of catching up on other homework. I've got a J2EE lab to catch up on (due tonight), and the next Game Dev lab (a rotating mesh) due tomorrow. I finally got my Philosophy book, too, so I get to read all about Plato tonight, as well.
Oh, and a Karate group lesson tonight; yay for more sparring!
I saw a picture in the Penny Arcade forums (I hang out in the Games and Technology forum there quite a bit) that was fairly...disturbing. Usually I expect a Calvin and Hobbes strip (even a photoshop'd imitation, like this one) to have the same ironic twist of humor that it always does. This one, though...really didn't sit well with me.