XNA Creators Club Online
Page 1 of 1 (6 items)
Sort Posts: Previous Next

Looking for fresh ideas..

Last post 10/3/2009 8:31 PM by Mr T92. 5 replies.
  • 10/2/2009 4:58 AM

    Looking for fresh ideas..

    I have created a little DirectX 3D program using C# in VS2008. Program uses both a Windows form and a Directx 3D device. Program runs fine in a couple of different PC's. I have two machine with issues. I am using DirectX 9 Mar09 SDK. All the machines run dxdiag no problems... 3D Cube rotates like a charm.  On one machine, the 3D object that I build with my triangles simply does not appear.  Some text that I draw during render appears fine.. On second problem machine, the triangles all seem to be coming out of one vertex in 3D space(really odd).. I have code that rotates object..

    For vertex buffer I am using:
           vbb = new VertexBuffer(typeof(CustomVertex.PositionTextured), 97, D3device, Usage.Dynamic | Usage.WriteOnly, CustomVertex.PositionTextured.Format, Pool.Default);

    I am also using indices:
            ibb = new IndexBuffer(typeof(int), c_VERTices, D3device, Usage.WriteOnly, Pool.Default);

    I am using a texture array: public Texture[] texture = new Texture[23];

    This is the gist of device init:
        presentParams.Windowed = true;
        presentParams.SwapEffect = SwapEffect.Discard;

        DevType = Microsoft.DirectX.Direct3D.
    DeviceType.Hardware; // try simple hardware..

        D3device =

    new Microsoft.DirectX.Direct3D.Device(0, DevType, this, DevFlags, presentParams);

    The render loop just iterates through the buffer drawing triangle strips:
        D3device.DrawIndexedPrimitives(PrimitiveType.TriangleStrip, 0, 0, c_VERTices, 4 * b, 2);

     

     

     

    (Went through enough issues to get triangles to cull properly and show the correct texture.. Machines 1,2 & 3 work fine. Machines Z & D are dogs.. But dxdiag works on all)

    Any ideas from anyone who has seen any kind of graphics card inconsistencies would be greatly appreciated..

     

    As a followup question, is there any location(link) from which Dxdiag code can be downloaded...
  • 10/2/2009 9:39 AM In reply to

    Re: Looking for fresh ideas..

    I suggest you update the video drivers on the problem machines and verify their support for Direct X 9. (Older cards perhaps?)

    I also recommend you visit Windows Update on the problem machines and install any potentially relevant updates.

    I could not find a download link for DXDIAG.
  • 10/2/2009 10:38 PM In reply to

    Re: Looking for fresh ideas..

    Kyle, thanks for the prompt response. I updated the PC in question to SP3 and installed all the latest Windows updates. No improvement. I also updated the driver of the Video card in the PC. No improvement. 

    Here is some additional info that may or may not be relevant. The video is via an Intel Graphics 915GM/GMS Express Chipset and when I run dxdiag I get (AGP Texture Acceleration shows as "Not Available"). This link http://www.intel.com/support/graphics/sb/cs-009689.htm says something about local memory that I am not aware of how my code could be impacting this.

    However as I stated earlier, the dxdiag 3D cube runs fine and I downloaded another 3D directX application "triangles" from DrunkenHyena and that also runs fine. Could there be some Zdirection(visual layering) control that's causing my triangles to be behind the Windows form on this particular machine? Could there be something else that I need to do to ensure that the 3D image is always on top when my app gets focus?

    I did some additional testing by replacing the texture array with just a single texture, but with no improvement. I also drew just the first four triangles as a test, but again with no improvement.
  • 10/2/2009 11:40 PM In reply to

    Re: Looking for fresh ideas..

    I don't think any sort of window Z-order setting is likely to be the problem. My only other thoughts are that you could either try putting a different video card in one of the problem machines, or you could try porting your application to XNA. If I understand correctly, your app is currently written in Managed DirectX, which is a deprecated technology.

    Perhaps someone else will chime in with other ideas.
  • 10/3/2009 12:43 PM In reply to

    Re: Looking for fresh ideas..

    Its not deprecated its no longer supported, there is a differences there. Besides MDX apps should run fine on any DX9 hardware
  • 10/3/2009 8:31 PM In reply to

    Re: Looking for fresh ideas..

    I tend to agree with NightCreature as far as terminology regarding the state of DirectX. I am going to take a look at XNA to see if I want to move to it for the next version of my app. But that's another story..

    Anyways, Kyle thanks for the discussion. I resolved the problem with my code and I am running fine on both machines which I had tagged as dogs. You may have noticed that I was using DrawIndexedPrimitives in my render code and this was one of the differences between the DrunkenHyena triangle sample that worked and my code. His code was using DrawUserPrimitives. I started doing a bit of research on DrawIndexedPrimitives and learnt that the older cards did not support 32 bit index buffers. So, I modified my code to use shorts for the index buffer and voila...

Page 1 of 1 (6 items) Previous Next