- window_params.m_IconifyCallback = OnWindowIconify;
- window_params.m_IconifyCallbackUserData = engine;
- window_params.m_Width = engine->m_Width;
- window_params.m_Height = engine->m_Height;
- window_params.m_Samples = dmConfigFile::GetInt(engine->m_Config, "display.samples", 0);
- window_params.m_Title = dmConfigFile::GetString(engine->m_Config, "project.title", "TestTitle");
- window_params.m_Fullscreen = (bool) dmConfigFile::GetInt(engine->m_Config, "display.fullscreen", 0);
- window_params.m_PrintDeviceInfo = dmConfigFile::GetInt(engine->m_Config, "display.display_device_info", 0);
- window_params.m_HighDPI = (bool) dmConfigFile::GetInt(engine->m_Config, "display.high_dpi", 0);
-
- dmGraphics::WindowResult window_result = dmGraphics::OpenWindow(engine->m_GraphicsContext, &window_params);
- if (window_result != dmGraphics::WINDOW_RESULT_OK)
- {
- dmLogFatal("Could not open window (%d).", window_result);
- return false;
- }
-
- uint32_t physical_dpi = dmGraphics::GetDisplayDpi(engine->m_GraphicsContext);
- uint32_t physical_width = dmGraphics::GetWindowWidth(engine->m_GraphicsContext);
- uint32_t physical_height = dmGraphics::GetWindowHeight(engine->m_GraphicsContext);
- engine->m_InvPhysicalWidth = 1.0f / physical_width;