DmGoober

Members
  • Content count

    194
  • Joined

  • Last visited

Community Reputation

136 Neutral

About DmGoober

  • Rank
    Member
  1. This worked for me: 1) Remove the references to the assemblies that are LoaderLocking. (I recommend writing down the path to the assembly so you don't forget it.) 2) Rebuild. The build will fail. 3) Add back the references to the assemblies you just removed. 4) Rebuild and re-run. Alexander
  2. I should mention that: 1) Setting ANY RenderState inside the BeginStateBlock/EndStateBlock fails. For example: this.device.RenderState.FogDensity = 0.0f; inside the block does absolutely nothing. 2) Setting the render state outside the BeginStateBlock/EndStateBlock works perfectly fine. Thanks in advance.
  3. Using managed directx, I'm trying to capture a StateBlock. My code looks something like this: this.device.BeginStateBlock(); this.device.VertexFormat = SimpleVertex.Format; this.stateBlock = this.device.EndStateBlock(); this.stateBlock.Capture(); if (this.device.VertexFormat != SimpleVertex.Format) { MessageBox.Show("Failed!"); } For some reason, setting the VertexFormat inside BeginStateBlock()/EndStateBlock() fails to set the format (much less capture it.) Why is the VertexFormat not being set?
  4. In the meantime, google the ".NET bootstrapper." It will automatically download and install .NET.
  5. Coming up with your game name

    If you name your game without using "real" words you will have a much easier time enforcing copyright/trademark. Don't name your game "Game" or "Shooter." Name your game "Gaeme" or "Shuter." Or combine two "real" words into a fake word: GameShooter. (Ok, that's a horrible example, but you get the idea.) That said, choose a game name that has something to do with the game and has some meaning for the player! Calling your game "Xzibigible" may sound alien and interesting, but it means absolutely nothing to most people and because it has no meaning, it will easily be forgotten. (Basic psychology -- people have an easier time remembering "fake" words if they have the form and letter combinations of real words. Try it: memorize: "BigglePops" vs. "Bglgepspoi") Check out Scott Miller's blog for an interesting tirade on this subject.
  6. Rotate the camera around an object

    Look at the D3D samples. There's a class called "ArcBall" which allows the user to rotate a camera around an object. I personally find it a little bit overly complex, but it works.
  7. I'm not familiar with MultiplyTransform. In what order does it multiply the matrices? That is, does MultiplyTransform multiply the argument to the left or the right? BTW, Dave's code can be made a little bit simpler and more efficient by doing this: Matrix newWorld = otherobj.getLocalWorld; newWorld.Multiply(Matrix.Translation(thisobj.xloc,thisobj.yloc,thisobj.zloc)); dxdevice.Transform.World = newWorld; (There's no reason to init newWorld to identity.) Personally, I write out all of my matrix math as clearly as possible, using as few methods as possible (the methods tend to make the order that things are being multiplied in very confusing.) Certainly, c = c * b may be a teeny bit slower than c.Multiply(b), but the first bit of code is clearer to me what's going on.
  8. Are you dealing with Vertex Buffers and Index Buffers directly or are you using the Direct3D "Mesh" class? As much as I like the Mesh class for simple rendering and prototyping, I don't know what's going on under the covers, so I try to stay away from it for "production" code. Do your skinned meshes all share the same mesh? If yes, then simply setting the VB/IB only once per mesh per frame should make a huge difference (I believe, don't quote me on this, that if you create, say, one hundred Mesh objects and tell them all to render, you'll end up setting the VB/IB one hundred times! This a huge waste of time, especially if the VB and IB for each mesh is exactly the same.) In general, I stay away from the Mesh class as it tends to be overally complex and inefficient. You may want to invest time into understanding and parsing the .X format yourself so you can have full control. "General solutions are generally inefficient." The Mesh class is a general solution.
  9. Managed DX: OnPaint Problem

    Thanks Martaver! That was my first design (having a main render loop that "touches" each RenderPanel to tell it to refresh). I was hoping I could get away with the main form not knowing anything about Rendering Panels (ie having each render panel be self contained, with the main loop knowing nothing about it) but I guess that won't work because the Render Panels end up acting selfishly. Now of course, the problem is that my main render loop is going to hog all of the CPU time from the non-custom controls! =) In other words: OnEachTick { Invalidate Render Panel 1 Invalidate Render Panel 2 ... } Will share CPU time amongst the Render Panels, but the other controls are still going to be CPU starved... Maybe this is one of the cases where it's best to go back to the dreaded Application.DoEvents() model... (Though I suppose: OnEachTick { Invalidate Render Panel 1 Invalidate Form and Children } will also do the trick, but that will needlessly redraw all of the other controls every tick...
  10. Managed DX: OnPaint Problem

    Here's a simpler explanation: public class TestPanel : Panel { public TestPanel() { //Setup the panel to paint in WMPaint. this.Setstyle(Controlstyles.AllPaintingInWmPaint | Controlstyles.Opaque | Controlstyles.UserPaint, true); } protected override void OnPaint(PaintEventArgs e) { Invalidate(false); //DEBUG Only! } } Add this panel to a form and all other controls will stop rendering correctly.
  11. I'm writing a game that has multiple views of the 3D Game World. Because of this, I have multiple devices, each associated with different System.Windows.Forms.Panel objects (ie, my devices are not tied to the Form, they are tied to panels.) I've created a new class, RenderPanel, that flags each Panel's style as: AllPaintingInWmPaint, Opaque, and UserPaint. My OnPaint override renders everything then calls Invalidate(), so that OnPaint is called again pretty much immediately. Unfortunately, whenever I Invalidate() my RenderPanel, OTHER controls in the same form stop rendering (the desktop shows through where these other controls should be.) My RenderPanels render everything fine, but nobody else works correctly. If I comment out the "Invalidate()" call on my panel, everything works fine (except that my panel's OnPaint is not called every frame.) It doesn't seem like Invalidating my panel should have any effect on any other controls that happen to be in the same Form... Any suggestions? Thanks in advance.
  12. Uh.. nevermind. It helps if I set the control's Visible property to true. =)
  13. I've been trying to get Managed Direct3D to render to a control other than Form. I've set the control's style with: this.Setstyle(Controlstyles.AllPaintingInWmPaint | Controlstyles.Opaque, true); this.Updatestyles(); And tried overriding OnPaint. Unfortunately, OnPaint is never called, and the control remains blank. Is AllPaintingInWmPaint a style that only applies to forms? Anyone have any hints? Thanks.