Problem wih Beta 2

Hi,
i was trying GSE beta 1. It was working ok. Now i have just installed Beta 2 and i got problem.
When i try to do:
m_spriteBatch = new SpriteBatch(GraphicsDevice);
i get exception "The method call is invalid."

also when i try to run code that we can find in XNA GSE Programming Guide : Use BasicEffect i get exception "Both a valid vertex shader and pixel shader (or valid effect) must be set on the device before draw operations may be performed." in line
"graphics.GraphicsDevice.DrawPrimitives...."

does any one know how to fix this problems
thanks for any help!


Answer this question

Problem wih Beta 2

  • edukulla

    Unfortunatly, your defintion of latest is vastly outdated. Instead what you need is a card/chip, from 3(with DX10) whole generations ago! Of which can be bought for around $40, and is around 3 years old. (i.e Geforce FX5200)

  • Dorian Dechant

    support his opinion.

    Hope to support fix-pipeline graphics.  It should be ideas and content that are real count for a game, rather than just greate graphics supported by shaders. 

    .net framework 2.0 + sm2.0 card + c#. It's hard, not easy.


  • Asday

    Dude I have the same problem. The invalid method call. I've tried so many things. My friend X-Tatic told me it might be my video card (which is the stupid Intel Integraded Graphics Card). I'm hoping it isn't though. I get the same message when I try to run SpaceWar. I hope someone can answer that question for me as well.

  • Thomas Weiss

    Same prob here.....
    Intel dx8.1 grfx card on laptop
    I want to upgrade now (have the cash) but dx10 is just around corner and dont want to get dx9 grfx when 10 is only months away in laptops, guess Im screwed

    Heres a fix: sorta

    whereever it throws an exception add empty try catch block on that line of code

    try
    {
    code throwing exception;
    }
    catch (InvalidOperationException e)
    {
    }

    After that you get a BUNCH of NullReferenceExceptions dealing with same pieces of code
    go thru and add more empty try/catches on these too.

    This will allow it to compile.
    I moved the compiled executeable to a puter w/ dx9 grfx card and it ran fine.
    Although even though beta 1 compiled it never ran spacewar right neway on my lappie.

    But for now this should get u compiling.

  • cdun2

    Ampers wrote:
    ... people of MS, what do we do if we want to use XNA My code copiles perfectly but I can't test it!

    Simply don't use SpriteBatch. Use your own redering method with a shader that your hardware supports i.e (ps_1_1).



  • QWERTYtech

    I have an Intel Integrated card as well and also cannot run with beta 2, but worked fine in beta 1. It looks like beta 2 has made it mandatory that you have a pixel shader, which the integrated card does not have. Although it has a vertex shader which is odd...

    Regards


  • Penny Ong

    Well I have to post here because I just had the same problem but when loading a simple 3D model.

    The problem seems to be that my graphic card does not accept Shader Models 2.0 (DirectX 8.1) since it is an old card, nVidia GeForce4. Yet I don't want to upgrade now because we have DirectX 10 (using Shader Models 4.0) coming up in a short time and I want a card that supports it.

    To inform the community I have just found that for the last part of this year the first nVidia processors supporting that technology will be released, so we can expect them to come shortly in a few weeks (I found nothing about ATI or others). But until then... people of MS, what do we do if we want to use XNA My code copiles perfectly but I can't test it!


  • sinan.topuz

    Run the dx9 device caps sample and see what that tells you about your card. Beta 1 shouldn't have worked if you didn't have minimal 1.1 pixel shader support. The spacewars evolved 3d upgrade models had to have been using shaders, to display at all!

    Chances are that something somewhere in XNA is setting the minimum pixel shader mode to 2.0


  • Yuhong Bao

    Make sure that the following code:

    graphics = new GraphicsComponent(this);

    is now this:

    graphics = new GraphicsDeviceManager(this);

    The object required for graphics has changed in B2.

    Hopefully, that helps.


  • Dirk Haest

    Ditto, here on my laptop.

    tankImage = content.Load<Texture2D>(@"Content/Graphics/tank");

    spriteBatch = new SpriteBatch(graphics.GraphicsDevice);

     

    Causes invalid method call.

    Going to load on my desktop and see if issue persists.

     

     

    ***************************************************************************

    UPDATE:

     

    I just loaded XNA beta2 on my desktop with a Radeon 9600 and this same line of code works fine. Must have something to do with DirectX 9 hardware compatability.


  • WWC

    I thought that the philosophy behind XNA was to democratize game development!! So as I understand, this is the kind of "democracy" we see in real life. Only available to rich people who can afford the latest hardware.

    i'm pretty disappointed by this :(

    okcompute.

  • perf101

    At least in theory, XNA has always required the card to support pixel shaders.

    It's vaguely possible that the SpriteBatch implementation in beta1 wasn't checking for this, and would somehow let you get away without one, but that was never the intention!


  • Bulldog.NET

    Yea same here, beta 1 worked just fine but with the new one I get that error when I compile anything that uses the sprite batch I havent really messed around to see if I get the same problem somewhere else

  • sasllc

    ok so it was fun to playing around with XNA :(

  • Problem wih Beta 2