2
0

Main.cpp 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #include "BsApplication.h"
  2. #include "BsCrashHandler.h"
  3. #include "BsCoreThread.h"
  4. #if BS_PLATFORM == BS_PLATFORM_WIN32
  5. #include <windows.h>
  6. using namespace BansheeEngine;
  7. int CALLBACK WinMain(
  8. _In_ HINSTANCE hInstance,
  9. _In_ HINSTANCE hPrevInstance,
  10. _In_ LPSTR lpCmdLine,
  11. _In_ int nCmdShow
  12. )
  13. {
  14. CrashHandler::startUp();
  15. __try
  16. {
  17. RENDER_WINDOW_DESC renderWindowDesc;
  18. renderWindowDesc.videoMode = VideoMode(200, 200); // TODO - Get desktop resolution
  19. renderWindowDesc.title = "Banshee Game"; // TODO - Get this from game settings
  20. renderWindowDesc.fullscreen = false; // TODO - Get this from game settings
  21. RenderAPIPlugin renderAPI = RenderAPIPlugin::DX11; // TODO - Get this from game settings
  22. Application::startUp(renderWindowDesc, renderAPI);
  23. // TODO - If on first run start in fullscreen (perhaps Build settings controlled) at desktop resolution
  24. const VideoModeInfo& videoModeInfo = RenderAPI::getVideoModeInfo();
  25. const VideoOutputInfo& primaryMonitorInfo = videoModeInfo.getOutputInfo(0);
  26. const VideoMode& selectedVideoMode = primaryMonitorInfo.getDesktopVideoMode();
  27. RenderWindowPtr window = gApplication().getPrimaryWindow();
  28. window->setFullscreen(gCoreAccessor(), selectedVideoMode);
  29. // TODO - Load main scene
  30. Application::instance().runMainLoop();
  31. Application::shutDown();
  32. }
  33. __except (gCrashHandler().reportCrash(GetExceptionInformation()))
  34. {
  35. PlatformUtility::terminate(true);
  36. }
  37. CrashHandler::shutDown();
  38. return 0;
  39. }
  40. #endif // End BS_PLATFORM