summaryrefslogtreecommitdiff
path: root/src/video/win32_v.cpp
diff options
context:
space:
mode:
authorMichael Lutz <michi@icosahedron.de>2021-02-24 23:06:56 +0100
committerMichael Lutz <michi@icosahedron.de>2021-02-25 00:34:49 +0100
commit311df31fb1bd6805344d2d07c0b43a398efbc14b (patch)
treebcb44512a8a42eea6629eee63b1d826d8ed7d8c6 /src/video/win32_v.cpp
parenta0c1a3f736b8b3665232c565c3ebea2b090be04b (diff)
downloadopenttd-311df31fb1bd6805344d2d07c0b43a398efbc14b.tar.xz
Codechange: [OpenGL] Load all OpenGL functions dynamically.
Diffstat (limited to 'src/video/win32_v.cpp')
-rw-r--r--src/video/win32_v.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/video/win32_v.cpp b/src/video/win32_v.cpp
index e6b5898ca..131a991f3 100644
--- a/src/video/win32_v.cpp
+++ b/src/video/win32_v.cpp
@@ -1285,10 +1285,15 @@ static PFNWGLCREATECONTEXTATTRIBSARBPROC _wglCreateContextAttribsARB = nullptr;
static PFNWGLSWAPINTERVALEXTPROC _wglSwapIntervalEXT = nullptr;
static bool _hasWGLARBCreateContextProfile = false; ///< Is WGL_ARB_create_context_profile supported?
-/** Platform-specific callback to get an OpenGL funtion pointer. */
+/** Platform-specific callback to get an OpenGL function pointer. */
static OGLProc GetOGLProcAddressCallback(const char *proc)
{
- return reinterpret_cast<OGLProc>(wglGetProcAddress(proc));
+ OGLProc ret = reinterpret_cast<OGLProc>(wglGetProcAddress(proc));
+ if (ret == nullptr) {
+ /* Non-extension GL function? Try normal loading. */
+ ret = reinterpret_cast<OGLProc>(GetProcAddress(GetModuleHandle(L"opengl32"), proc));
+ }
+ return ret;
}
/**