mirror of
https://github.com/love2d/love.git
synced 2026-08-14 10:13:46 +02:00
Show a popup error if love.window loads but love.graphics does not.
Also include backend-specific errors in graphics initalization error messages. Improves visibility of errors related to vulkan/metal/opengl initialization. Related to #2335.
This commit is contained in:
@@ -39,6 +39,7 @@
|
||||
#include <set>
|
||||
#include <sstream>
|
||||
#include <array>
|
||||
#include <tuple>
|
||||
|
||||
#define VOLK_IMPLEMENTATION
|
||||
#include "libraries/volk/volk.h"
|
||||
@@ -3603,9 +3604,10 @@ void Graphics::recreateSwapChain()
|
||||
transitionColorDepthLayouts = true;
|
||||
}
|
||||
|
||||
love::graphics::Graphics *createInstance()
|
||||
std::tuple<love::graphics::Graphics *, std::string> createInstance()
|
||||
{
|
||||
love::graphics::Graphics *instance = nullptr;
|
||||
std::string err;
|
||||
|
||||
try
|
||||
{
|
||||
@@ -3613,11 +3615,10 @@ love::graphics::Graphics *createInstance()
|
||||
}
|
||||
catch (love::Exception &e)
|
||||
{
|
||||
if (isDebugEnabled())
|
||||
printf("Cannot create Vulkan renderer: %s\n", e.what());
|
||||
err = "Cannot create Vulkan renderer: " + std::string(e.what()) + "\n";
|
||||
}
|
||||
|
||||
return instance;
|
||||
return { instance, err };
|
||||
}
|
||||
|
||||
} // vulkan
|
||||
|
||||
Reference in New Issue
Block a user