diff --git a/source/Platform/Win32/Win32GLContext.cpp b/source/Platform/Win32/Win32GLContext.cpp index 4215580..bc5e860 100644 --- a/source/Platform/Win32/Win32GLContext.cpp +++ b/source/Platform/Win32/Win32GLContext.cpp @@ -17,21 +17,25 @@ static GLADapiproc func_loader(const char *name) { } // Ensure that OpenGL extensions are loaded. -static void ensureExtensionsLoaded(HDC dc) +static bool ensureExtensionsLoaded(HDC dc) { static bool init = false; if (!init) { - init = true; if (!gladLoadWGL(dc, func_loader)) { Log::error("WGL: Could not load WGL extensions"); + return false; } if (!gladLoaderLoadGL()) { Log::error("WGL: Could not load OpenGL extensions"); + return false; } + + init = true; } + return true; } Win32GLContext::Win32GLContext() :