The values used in the attempt to create the GraphicsDevice were invalid.

Is this because my graphic card does not support shader model 2
I didn't even know of this requirement till I saw it on the readme file.
Time to change my geforce4


Answer this question

The values used in the attempt to create the GraphicsDevice were invalid.

  • aCaen

    Thanks for the reply Paul, I have a geforce 4 ti4200 on this pc.
    I get this error in the InitializeComponent method of the sample projects

  • Vulcanoro

    And apparently I'm unable to make edits to my posts.

    Anyway, the error is this (it happens at runtime):

    "NoSuitableGraphicsDeviceException was unhandled" on line 26 of SpacewarGame.Design.cs

  • Ion101

    What type of card do you have We should be giving a better exception message than that (i.e. we check for lots of things and throw better exceptions but that one must have slipped through.)

  • Emanuel Dejanu

    IIRC the Rage 128 is DX7 era hardware. You'll need a card that supports the programmable pipeline (we recommend something that supports at least Shader Model 2.0 or above). You can find reasonably priced SM2.0 cards these days (or check Ebay).



  • nwyork

    I tried that, but I continue to get the same error. I'm just trying to build the basic Windows Game (XNA) project (from File->New). The relevant (I think) code looks like this:

    private void InitializeComponent()
    {
    this.graphics = new Microsoft.Xna.Framework.Components.GraphicsComponent();
    this.graphics.AllowMultiSampling = false;
    this.GameComponents.Add(this.graphics);
    }

    There's no WindowsGame_Starting function in this example.

    Any suggestions

    AG


  • Alex-MyRpg

    Struan wrote:

    I got it to work. Add this line after the Graphics component is created:

    graphics.AllowMultiSampling = false;

    Then in the WindowsGame_Starting function set graphics.AllowMultiSampling equal to false again.



    THAT WORKED!!
    Good on ya mate
    This is a congratulatory sheep ->


  • Henny

    try line 109 in SpacewarGame.cs

  • Carl Bruneau

    Groovy. This is a bug. We're supposed to fallback to disable multisampling if it isn't available. I'll file a bug.



  • piccolo2101

    Yeah, that did it. Thanks a lot!
  • ElliotHC

    Hi Aaron

    What type of graphics hardware do you have



  • Weavor

    Nvidia GeForce 4 Ti 4600 here, same error - total bummer too, might have to work on the laptop for a while until I either buy a new card or a solution arises... still, looks like nice concise code, reminds me of the Jad engine, good stuff guys at least from what I can see of it :)


  • krhoover

    According to my Device Manager, I have a Rage 128 Pro Ultra GL AGP. What should I have in order to create and run games in XNA

    AG


  • josef koory

    I'm getting the same error here at work..... card is an nVidia Quadro 2. lol.... not sure if its the shader model or what.

  • mono_blaine

    I got it to work. Add this line after the Graphics component is created:

    graphics.AllowMultiSampling = false;

    Then in the WindowsGame_Starting function set graphics.AllowMultiSampling equal to false again.


  • The values used in the attempt to create the GraphicsDevice were invalid.