Game Methods

Public Methods

Name Description
Public Method Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
Public Method Equals (Inherited from Object.)
Public Method Exit Exits the game.
Public Method GetHashCode (Inherited from Object.)
Public Method GetType (Inherited from Object.)
Public Method ResetElapsedTime Resets the elapsed time counter.
Public Method Run Call this method to initialize the game, begin running the game loop, and start processing events for the game.
Public Method RunOneFrame Run the game through what would happen in a single tick of the game clock; this method is designed for debugging only.
Public Method SuppressDraw Prevents calls to Draw until the next Update.
Public Method Tick Updates the game's clock and calls Update and Draw.
Public Method ToString (Inherited from Object.)

Protected Methods

Name Description
Protected Method BeginDraw Starts the drawing of a frame. This method is followed by calls to Draw and EndDraw.
Protected Method BeginRun Called after all components are initialized but before the first update in the game loop.
Protected Method Draw Called when the game determines it is time to draw a frame.
Protected Method EndDraw Ends the drawing of a frame. This method is preceeded by calls to Draw and BeginDraw.
Protected Method EndRun Called after the game loop has stopped running before exiting.
Protected Method Finalize Allows a Game to attempt to free resources and perform other cleanup operations before garbage collection reclaims the Game.
Protected Method Initialize Called after the Game and GraphicsDevice are created, but before LoadContent.
Protected Method LoadContent Called when graphics resources need to be loaded.
Protected Method MemberwiseClone (Inherited from Object.)
Protected Method OnActivated Raises the Activated event. Override this method to add code to handle when the game gains focus.
Protected Method OnDeactivated Raises the Deactivated event. Override this method to add code to handle when the game loses focus.
Protected Method OnExiting Raises an Exiting event. Override this method to add code to handle when the game is exiting.
Protected Method ShowMissingRequirementMessage This is used to display an error message if there is no suitable graphics device or sound card.
Protected Method UnloadContent Called when graphics resources need to be unloaded. Override this method to unload any game-specific graphics resources.
Protected Method Update Called when the game has determined that game logic needs to be processed.

See Also

Reference

Game Class
Microsoft.Xna.Framework Namespace