diff --git a/framework/platform-dx/game.cpp b/framework/platform-dx/game.cpp index 8c544d6..442e2ff 100644 --- a/framework/platform-dx/game.cpp +++ b/framework/platform-dx/game.cpp @@ -68,14 +68,19 @@ namespace xna { } int Game::Run() { - Initialize(); + try { + Initialize(); - if (graphicsDevice == nullptr) { - MessageBox(nullptr, "O dispositivo gráfico não foi inicializado corretamente", "XN65", MB_OK); - return EXIT_FAILURE; + if (graphicsDevice == nullptr) { + MessageBox(nullptr, "O dispositivo gráfico não foi inicializado corretamente", "XN65", MB_OK); + return EXIT_FAILURE; + } + + return StartGameLoop(); } - - return StartGameLoop(); + catch (std::exception& e) { + MessageBox(nullptr, e.what(), "XN65", MB_OK); + } } void Game::Initialize() { diff --git a/samples/01_blank/xna.cpp b/samples/01_blank/xna.cpp index a613eb4..8affb70 100644 --- a/samples/01_blank/xna.cpp +++ b/samples/01_blank/xna.cpp @@ -25,10 +25,7 @@ namespace xna { } void LoadContent() override { - spriteBatch = New(*graphicsDevice); - - auto effect = Content()->Load("ExitReached"); - + spriteBatch = New(*graphicsDevice); Game::LoadContent(); }