[Feat] (Diligent/EGL_Init, MG_State/Getter): separates engine init and swapchain creation

This commit is contained in:
2025-06-27 13:47:43 +08:00
parent d056acf0af
commit a5a661261d
2 changed files with 56 additions and 26 deletions
@@ -76,7 +76,10 @@ namespace MG_GL::Getter {
const std::string GetGPUName() {
#if BACKEND_TYPE == BACKEND_DILIGENT
return MG_Diligent::g_pDevice->GetAdapterInfo().Description;
if (MG_Diligent::g_pDevice)
return MG_Diligent::g_pDevice->GetAdapterInfo().Description;
return "<not set yet>";
#else
return "<unknown GPU>";
#endif
@@ -84,7 +87,10 @@ namespace MG_GL::Getter {
const uint32_t GetBackendGfxAPIVersionMajor() {
#if BACKEND_TYPE == BACKEND_DILIGENT
return MG_Diligent::g_pDevice->GetDeviceInfo().APIVersion.Major;
if (MG_Diligent::g_pDevice)
return MG_Diligent::g_pDevice->GetDeviceInfo().APIVersion.Major;
return 0;
#else
return 0;
#endif
@@ -92,7 +98,10 @@ namespace MG_GL::Getter {
const uint32_t GetBackendGfxAPIVersionMinor() {
#if BACKEND_TYPE == BACKEND_DILIGENT
return MG_Diligent::g_pDevice->GetDeviceInfo().APIVersion.Minor;
if (MG_Diligent::g_pDevice)
return MG_Diligent::g_pDevice->GetDeviceInfo().APIVersion.Minor;
return 0;
#else
return 0;
#endif