Fix async shader compiler on Windows

This commit is contained in:
wheremyfoodat 2024-08-11 02:37:22 +03:00
parent 0793032ece
commit 927a19d4f5
2 changed files with 19 additions and 0 deletions

View file

@ -19,6 +19,14 @@ public:
/// Prevents the function from being invoked when we go out of scope.
ALWAYS_INLINE void Cancel() { m_func.reset(); }
/// Runs the destructor function now instead of when we go out of scope.
ALWAYS_INLINE void Run() {
if (!m_func.has_value()) return;
m_func.value()();
m_func.reset();
}
/// Explicitly fires the function.
ALWAYS_INLINE void Invoke()
{

View file

@ -19,6 +19,17 @@ static void* GetProcAddressCallback(const char* name)
}
namespace GL {
static bool ReloadWGL(HDC dc)
{
if (!gladLoadWGL(dc))
{
Log_ErrorPrint("Loading GLAD WGL functions failed");
return false;
}
return true;
}
ContextWGL::ContextWGL(const WindowInfo& wi) : Context(wi) {}
ContextWGL::~ContextWGL()