Does the DeviceCreated event happen more than once during execution?

I'm trying to puzzle through how SpaceWar works, and I noticed that CreateShip appears a couple of times for a given ship.

-In the "EvolvedShape" constructor

-When OnCreateDevice() is called

Is this on purpose I had figured that the graphics device gets created once when the game was first loaded and that was it, but is there some situation where the graphics device gets re-created, requiring the EvolvedShape to be re-initalized



Answer this question

Does the DeviceCreated event happen more than once during execution?

  • eljefe77

    So I guess that makes the DeviceCreated handler necessary, at least on windows . . . kind of a pain but oh well.
  • agentf1

    One instance - if the window is resized the device will have to be recreated.

  • Does the DeviceCreated event happen more than once during execution?