/// <summary> /// Create the Game wrapper class. /// </summary> /// <param name="game">GeonBit game instance (provided by the user).</param> public MonoGameGameWrapper(GeonBitGame game) { // store game class and set this pointer _game = game; _game._gameWrapper = this; // create graphics and init content root directory _graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; // if vsync disabled if (!_game.InitParams.EnableVsync) { _graphics.SynchronizeWithVerticalRetrace = false; IsFixedTimeStep = false; } }
/// <summary> /// Run GeonBit engine. /// Call this function from your program Main() function, with the implementation of your GeonBitGame class. /// </summary> /// <param name="game">Your main 'game' class.</param> public void Run(GeonBitGame game) { using (var wrapper = new MonoGameGameWrapper(game)) wrapper.Run(); }