Results 1 to 8 of 8
  1. #1
    Join Date
    Aug 2010
    Location
    Denmark
    Posts
    233

    Post Should I use XNA 1.0 or XNA 4.0 in XNA Extreme 101? - code differences?

    Hi,

    I recently started learning C# and XNA via the XNA 101 Extreme Bundle. Amazing videos!

    I just finished Canon 2 and is going to make Canon 3 in XNA. Before that I am supposed to make a small "bouncing ball app".

    Since the videos are somewhat old, I have installed Microsoft Visual C# 2010 Express and XNA 4.0. Up to this point it has worked fine.

    When starting using XNA, however, I discovered some smaller variations in what I see in the videos and what are actually on my own screen when launching a new Windows game. For example the way you load graphical content differs in newer version - read this post about loading the texture "target.png" in XNA 3.1.

    Another thing that has changed in the standard XNA template is the following:

    In the video the code is as following:
    Code:
    protected override void LoadGraphicsContent(bool loadAllContent)
    {
    
       if (loadAllContent)
       {
        // TODO: Load any ResourceManagementMode.Automatic content
       }
    
       // TODO: Load any ResourceManagementMode.Manual content
    }
    While in my XNA 4 version the template looks like this:
    Code:
    protected override void LoadContent()
    {
       // Create a new SpriteBatch, which can be used to draw textures.
       spriteBatch = new SpriteBatch(GraphicsDevice);
    
       // TODO: use this.Content to load your game content here
    }
    As you can see, there are some minor differences between the two versions. If I manually try to type what I see in the videos, I get this error:
    Code:
    'WindowsGame1.Game.LoadGraphicsContent(bool)': no suitable method found to override
    As a person new to programming I do not know how to solve this.

    Therefore my question is: Should I keep on going with the new versions of Visual Studio and XNA? If yes, how do I solve this error?

    Or should I just install the older versions of Visual Studio and XNA, so my setup is precisely the same as in the videos? I guess that later on, when they/I start to make more complex games in XNA, I'll run into even more problems because of the different versions of XNA.

  2. #2
    Join Date
    Jun 2009
    Posts
    118
    There is no LoadGraphicsContent() anymore, you need to use LoadContent().

    There is a video on one of the disks that goes over porting stuff from XNA 1 to XNA 2 where they deal with this exact issue.

  3. #3
    Join Date
    Nov 2008
    Location
    41° 28′ 56″ N, 81° 40′ 11″ W
    Posts
    2,399
    Yes, as stated before, it's better that you have a book handy for the latest versions of XNA and C#/.Net, so you can understand the changes from the original XNA code and C# 2005 code and what you have in C# 2010 and XNA 4.0. The changes between the two are quite subtle, yet significant, too. Although, there is *some* backwards compatibility, there are a few quirks to that. I'd recommend the book for C# 2010 in this thread: http://www.3dbuzz.com/vbforum/showth...Volume-2/page2
    PC Specs: Antec 900 ATX Case, Gigabyte 790GX Mobo, AMD Phenom II x4 955, Corsair HX620W PSU, Corsair Vengeance 16GB (4x4GB) DDR3-1600, EVGA GTX 680 2GB GDDR5, 3D Vision Kit 2, LG 8x Blu-ray Burner, Intel X25-M SSD, 500GB+640GB WD Caviar Blacks, Win 7 Pro x64, DAS Pro K/B, MX518 Mouse, Logitech Z-2300 Speakers, Toshiba 32TL515U 32" 3DTV, Wacom Bamboo Fun Large Tablet.

  4. #4
    Join Date
    Aug 2010
    Location
    Denmark
    Posts
    233
    Thank you. I have ordered the C# 2010 book from Amazon

  5. #5
    Join Date
    May 2008
    Posts
    542
    XNA 4.0 also has changes in how 3d primitives are created... but you shouldn't have any need to worry about that in the XNA volumes(doubt volume 3 covers 3d)

    When I first came into the series, there was a newer version of XNA available. Once you get used to the changes(from experimentation and a bit of research), you'll have no issue.

    The changes make things better and more streamlined typically.
    Last edited by Raziaar; 10-12-2010 at 06:59 PM.
    Hello everyone and welcome to another 3DBuzz VTM, and tonight we'll be programming in Brain****!

  6. #6
    Join Date
    Nov 2008
    Location
    41° 28′ 56″ N, 81° 40′ 11″ W
    Posts
    2,399
    How could I have been so blind? I just found a book on Visual C# 2010 that was made by Microsoft themselves. In fact, I just looked at this book a couple of days ago at Barnes and Noble. I mean, who better to learn C# from than the ones that actually created the language itself? Of course, I'm not sure if the author of this book is an actual MSDN employee or not, but since it is an official MS book material, you can be rest assured that everything that's written will cover almost all the features and the code and windows form designs will be 100% accurate.

    http://www.amazon.com/gp/product/073...ef=oss_product

    Heh, what a coincidence, the author's last name is Sharp, wonder if there may be a connection here.
    Anyway, upon skimming through this book a couple of days ago, I do believe this may be one of the better books around, imo.
    PC Specs: Antec 900 ATX Case, Gigabyte 790GX Mobo, AMD Phenom II x4 955, Corsair HX620W PSU, Corsair Vengeance 16GB (4x4GB) DDR3-1600, EVGA GTX 680 2GB GDDR5, 3D Vision Kit 2, LG 8x Blu-ray Burner, Intel X25-M SSD, 500GB+640GB WD Caviar Blacks, Win 7 Pro x64, DAS Pro K/B, MX518 Mouse, Logitech Z-2300 Speakers, Toshiba 32TL515U 32" 3DTV, Wacom Bamboo Fun Large Tablet.

  7. #7
    Join Date
    Aug 2010
    Location
    Denmark
    Posts
    233
    Thank you for the heads up. I already bought the before-mentioned "C# For Dummies" book. I haven't read much, but due to its size it is a good reference guide. However, I must say that Buzz' videos are a WAY better learning tool than any other book I have read. They cover a lot, and they way it is represented is just so good and intuitive.

  8. #8
    Join Date
    Nov 2008
    Location
    41° 28′ 56″ N, 81° 40′ 11″ W
    Posts
    2,399
    True, but keep in mind that the VTMs cover only .NET 2.0/C# 2005. The books were only suggested so you can determine which parts of the code need to be updated for C# 2010/.NET 4.0, since there are some changes between the two that you should take note about. Nelso is also very good help to help you with the changes in C# code from the VTMs to current date. I own the Complete XNA Xtreme 101 Series myself, and as much as I do like it, I always look for an updated piece of material to make sure that what they teach, and what's most accurate for the current version, can find themselves, literally on the same page.
    PC Specs: Antec 900 ATX Case, Gigabyte 790GX Mobo, AMD Phenom II x4 955, Corsair HX620W PSU, Corsair Vengeance 16GB (4x4GB) DDR3-1600, EVGA GTX 680 2GB GDDR5, 3D Vision Kit 2, LG 8x Blu-ray Burner, Intel X25-M SSD, 500GB+640GB WD Caviar Blacks, Win 7 Pro x64, DAS Pro K/B, MX518 Mouse, Logitech Z-2300 Speakers, Toshiba 32TL515U 32" 3DTV, Wacom Bamboo Fun Large Tablet.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •