Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6
This is the forum to discuss the Wrox book Professional XNA Game Programming: For Xbox 360 and Windows by Benjamin Nitschke; ISBN: 9780470126776
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 26th, 2007, 09:37 PM
Authorized User
Points: 40, Level: 1
Points: 40, Level: 1 Points: 40, Level: 1 Points: 40, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2006
Location: La Vergne, TN, USA.
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jnbutler
Default Trying to understand execution flow

I think I have my brain around how the XNA game execution flows but correct me if I have this wrong.

When you start the game the <yourgame>Game.StartGame() is called from the Program.cs class file which creates a new <yourgame>Game object(all of the variables get assigned initial values and the constructor creates a new Graphics Device Manager, and a new Content Manager) then calls game.run().
This calls Initialize() and executes all the code there and at the end calls base.Initialize() and this calls LoadGraphicsContent()
(base.Initialize() I assume is something within XNA framework behind the scenes?) then it returns to Initialize() and goes on to the Update().

From what I could tell stepping through it with the debugger, this is where the loop starts. Update() runs it's code and at the bottom base.Update() calls Draw() runs it's code and then at the bottom base.Draw() calls Update() and the loop continues until the game is exited.

Please let me know if I got something wrong in that flow.
Thanks

jnbutler
__________________
jnbutler
  #2 (permalink)  
Old August 4th, 2007, 04:55 PM
Registered User
 
Join Date: Aug 2005
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I believe what happens is after your game has initialized itself, the application enters loop like below.
Code:
while (!isApplicationReadyToQuit) {...}
Inside that loop calls to Update() and Draw() are made. Now depending on what type of game timing is established will determine how often the Update() and Draw() methods get called. This is hidden by the framework.

The base.* versions of these methods are only responsible for executing the base functionality of the base class. I do not believe they make calls back and forth to each other. For example, base.Update() calls Draw() and vice versa.

Does that make sense?
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
I don't understand... jmsherry ASP.NET 2.0 Basics 17 July 23rd, 2007 12:28 PM
I still do not understand aude_poullain ASP.NET 1.0 and 1.1 Basics 2 February 7th, 2007 09:11 PM
Flow of execution of .NET assembly? karveajit .NET Framework 2.0 0 December 18th, 2006 09:15 AM
Who can understand this book? HandSomeLi All Other Wrox Books 2 October 20th, 2004 04:12 PM
i can't understand this error! ion Classic ASP Databases 2 September 23rd, 2003 03:57 PM



All times are GMT -4. The time now is 08:33 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.