diff options
author | Michael Lutz <michi@icosahedron.de> | 2021-01-16 16:43:05 +0100 |
---|---|---|
committer | Michael Lutz <michi@icosahedron.de> | 2021-02-22 22:16:07 +0100 |
commit | d7b96a424fdd939aa7de65153e3b9baa20edf626 (patch) | |
tree | 2ba9d0a6a4425b86903ba515557b391273ef9cea /src/video/win32_v.cpp | |
parent | ef478ade649add1ab1706370ff53bcb0c32798d1 (diff) | |
download | openttd-d7b96a424fdd939aa7de65153e3b9baa20edf626.tar.xz |
Codechange: [OpenGL] Use new-style extension testing introduced with OpenGL 3.0.
Diffstat (limited to 'src/video/win32_v.cpp')
-rw-r--r-- | src/video/win32_v.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/video/win32_v.cpp b/src/video/win32_v.cpp index c97dccf44..ddfe365f7 100644 --- a/src/video/win32_v.cpp +++ b/src/video/win32_v.cpp @@ -1331,6 +1331,12 @@ void VideoDriver_Win32GDI::PaintThread() # define PFD_SUPPORT_COMPOSITION 0x00008000 #endif +/** Platform-specific callback to get an OpenGL funtion pointer. */ +static OGLProc GetOGLProcAddressCallback(const char *proc) +{ + return reinterpret_cast<OGLProc>(wglGetProcAddress(proc)); +} + static FVideoDriver_Win32OpenGL iFVideoDriver_Win32OpenGL; const char *VideoDriver_Win32OpenGL::Start(const StringList ¶m) @@ -1412,7 +1418,7 @@ const char *VideoDriver_Win32OpenGL::AllocateContext() if (this->gl_rc == 0) return "Can't create OpenGL context"; if (!wglMakeCurrent(this->dc, this->gl_rc)) return "Can't active GL context"; - return OpenGLBackend::Create(); + return OpenGLBackend::Create(&GetOGLProcAddressCallback); } bool VideoDriver_Win32OpenGL::ToggleFullscreen(bool full_screen) |