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

Run XNA projects 2.0 on older PCs (in reference mode)?

Last post 08-16-2008 7:55 AM by danielh. 21 replies.
  • 12-22-2007 10:21 AM

    Run XNA projects 2.0 on older PCs (in reference mode)?

    Hi, I had started this little game in XNA 1.0 on a machine equipped with a Geforce 8 and everything was working very well.

    This weekend I need to work on a machine that has only an MX440 which as I understand is too old for DirectX9, and I have installed XNA 2.0.

    I had found a way to run the graphics on the CPU here: http://www.riemers.net/eng/Tutorials/XNA/Csharp/ShortTuts/Reference_device.php

    The trick was to add this method anywhere in the game class:

     

    void SetToReference(object sender, PreparingDeviceSettingsEventArgs eventargs)

    {

    eventargs.GraphicsDeviceInformation.CreationOptions = CreateOptions.SoftwareVertexProcessing;

    eventargs.GraphicsDeviceInformation.DeviceType = DeviceType.Reference;

    eventargs.GraphicsDeviceInformation.PresentationParameters.MultiSampleType = MultiSampleType.None;

    }

    ...and then call the method in the main method:

    if (GraphicsAdapter.DefaultAdapter.GetCapabilities(DeviceType.Hardware).MaxPixelShaderProfile < ShaderProfile.PS_2_0)

    graphics.PreparingDeviceSettings += new EventHandler<PreparingDeviceSettingsEventArgs> (SetToReference);

    Doing this in XNA 2.0, though, I get the following errors:

    'Microsoft.Xna.Framework.GraphicsDeviceInformation' does not contain a definition for 'CreationOptions' 

    The name 'CreateOptions' does not exist in the current context 

    Is there a way to fix this? Thanks!

  • 12-22-2007 3:43 PM In reply to

    Re: Run XNA projects 2.0 on older PCs (in reference mode)?

    SoftwareVertexProcessing = true;

    Reference your game class, and its graphicsdevice to get it.

    gameclass.Device.SoftwareVertexProcessing = true;

     

  • 12-22-2007 9:37 PM In reply to

    Re: Run XNA projects 2.0 on older PCs (in reference mode)?

    Thanks, but could you be more precise as to where exactly do I need to add these lines of code? I tried just putting them in the main method (let's say Game1()) and I get:

    The name 'SoftwareVertexProcessing' does not exist in the current context

    'Game1.Game1' does not contain a definition for 'Device'

    (I am still very new at all software programming).

  • 12-22-2007 9:46 PM In reply to

    Re: Run XNA projects 2.0 on older PCs (in reference mode)?

    Software vertex processing is not the same as the reference device!  The reference device is a pure-software renderer that does not use a graphics card.  Software vertex processing means vertex transforms happen on the CPU and rasterization happens on the graphics card.  It's still a "hardware" mode.

    You should not need to set software vertex processing when using the reference device, as everything happens in software anyway.  You should be able to safely omit that line.
    New Microsoft DirectX/XNA MVP  (*evil laugh*)
  • 12-22-2007 9:49 PM In reply to

    Re: Run XNA projects 2.0 on older PCs (in reference mode)?

    @ShawMishrak: you're saying the method I first posted should do the trick, then? Do you get the same errors if you try it in XNA game studio 2.0, or am I doing something wrong?
  • 12-22-2007 10:07 PM In reply to

    Re: Run XNA projects 2.0 on older PCs (in reference mode)?

    That method will work, provided you remove the CreateOptions line.  It's not needed.  I just tested it with XNA 2.0, your code minus the first line will give you a Reference device with software vertex processing.  Software vertex processing is implicit when you select a reference device.
    New Microsoft DirectX/XNA MVP  (*evil laugh*)
  • 12-23-2007 5:49 PM In reply to

    Re: Run XNA projects 2.0 on older PCs (in reference mode)?

    Ok what I did:

    -added the SetToReference method minus the line with CreateOptions;

    -added a call to this method from the main method (Game1());

    I get:

  • 12-23-2007 6:07 PM In reply to

    Re: Run XNA projects 2.0 on older PCs (in reference mode)?

    Do you have the DirectX SDK installed?  The reference device does not come with the DirectX redist.

    New Microsoft DirectX/XNA MVP  (*evil laugh*)
  • 12-23-2007 8:06 PM In reply to

    Re: Run XNA projects 2.0 on older PCs (in reference mode)?

    No, the DirectX SDK wasn't installed. I didn't have any errors though, well except for what I've shown you.

    Now I'm back on my Geforce8 machine, and hopefully next week I'll have an X800 Pro for the older computer so I should be able to avoid the problem. If not well I'll be back here pestering you with questions. Thanks for the help so far.

  • 12-23-2007 9:01 PM In reply to

    Re: Run XNA projects 2.0 on older PCs (in reference mode)?

    Even if you get REF working its so slow that its unusable for anything but the simple 'draw a textured cube' type scenarios. Most of the time you will be fed up of it about 15 minutes after you get it working and you will be glad to hand over the $50 for a card that will run it properly.

    REF is not designed as a software rasterizer and so has no speed optimizations. Its purpose is simply to show what the hardware SHOULD produce if the drivers and the hardware are operating correctly.

     


    The ZBuffer News and information for XNA
    Please read the forum FAQs - Bug reporting
  • 12-23-2007 11:03 PM In reply to

    Re: Run XNA projects 2.0 on older PCs (in reference mode)?

    Yeah I was definitely expecting something like 1 fps, but all I had on screen was a couple sprites and for basic programming issues this would have been sufficient. All I'm currently trying to do is a simple 2D Tetris. ;)
  • 01-09-2008 12:23 PM In reply to

    Re: Run XNA projects 2.0 on older PCs (in reference mode)?

    Hey all,

       I had done some development on XNA GS 1.0 about 5 months back and I had it working perfectly on my laptop using the software graphics emulation.  (Well, perfect enough to test on before deploying to XBOX and using the graphics hardware.)  As others have discovered, with the move to 2.0, my previous code no longer works.  I've tried the solutions above, and still get the same error that a compatible graphics device cannot be found.  Can someone post or point me to a complete working solution?  It can just be "Hello World" or whatever that I can build on.  Thanks in advance for your help, and I'm sure you'll be helping others down the line.

    PS-I've read it all before - "just upgrade your computer", "get a graphics card", "performance sucks anyway", etc. so please don't respond in that manner.  I understand the limitations, but I used the reference device very successfully in the past with 1.0, and I'd like to use it again.

    Thanks!

  • 01-09-2008 12:27 PM In reply to

    Re: Run XNA projects 2.0 on older PCs (in reference mode)?

    Update - one thing I noticed.  I currently have the Feb 2007 SDK installed.  Could that be the problem?  Do I need a newer version?  I tried to breakpoint the SetReference function and it nevers seems to trigger.