protected override void Update(GameTime gameTime)
 {
     if (nextState != null)
     {
         currentState = nextState;
         nextState    = null;
     }
     if (currentState != null)
     {
         currentState.Update(gameTime);
     }
     base.Update(gameTime);
 }
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            this.IsMouseVisible = true;
            Window.Title        = "Chapter Master Restoration";
            graphicsDevice      = GraphicsDevice;
            IsFixedTimeStep     = true;
            TargetElapsedTime   = TimeSpan.FromSeconds(1 / 60.0f);

            MyraEnvironment.Game = this;
            //MyraEnvironment.DrawMouseHoveredWidgetFrame = true;
            //MyraEnvironment.DrawWidgetsFrames = true;

            currentState = new State.LoadingState(this, GraphicsDevice, Content);

            Debug.WriteLine("loading state created");
        }
 public void ChangeState(State.State state)
 {
     nextState = state;
 }