diff options
author | sfan5 <sfan5@live.de> | 2021-04-17 15:55:32 +0200 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2021-04-17 16:07:17 +0200 |
commit | bd95662f0304f0a70a72b27e2b111cb9cf042d26 (patch) | |
tree | a9ba8014278b819ec8e2176610452fc80088d2c1 /source/Irrlicht/CWGLManager.cpp | |
parent | 4c0aff5aa819a28496039c2df0f1eff08c949197 (diff) | |
download | irrlicht-bd95662f0304f0a70a72b27e2b111cb9cf042d26.tar.xz |
WGLManager: fix wglCreateContextAttribsARB not being used
Diffstat (limited to 'source/Irrlicht/CWGLManager.cpp')
-rw-r--r-- | source/Irrlicht/CWGLManager.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/Irrlicht/CWGLManager.cpp b/source/Irrlicht/CWGLManager.cpp index e45c96a..b807acb 100644 --- a/source/Irrlicht/CWGLManager.cpp +++ b/source/Irrlicht/CWGLManager.cpp @@ -26,6 +26,7 @@ CWGLManager::CWGLManager() #ifdef _DEBUG
setDebugName("CWGLManager");
#endif
+ memset(FunctionPointers, 0, sizeof(FunctionPointers));
}
CWGLManager::~CWGLManager()
@@ -206,6 +207,9 @@ bool CWGLManager::initialize(const SIrrlichtCreationParameters& params, const SE os::Printer::log("WGL_extensions", wglExtensions);
#endif
+ // Without a GL context we can't call wglGetProcAddress so store this for later
+ FunctionPointers[0] = (void*)wglGetProcAddress("wglCreateContextAttribsARB");
+
#ifdef WGL_ARB_pixel_format
PFNWGLCHOOSEPIXELFORMATARBPROC wglChoosePixelFormat_ARB = (PFNWGLCHOOSEPIXELFORMATARBPROC)wglGetProcAddress("wglChoosePixelFormatARB");
if (pixel_format_supported && wglChoosePixelFormat_ARB)
@@ -400,7 +404,7 @@ bool CWGLManager::generateContext() HGLRC hrc;
// create rendering context
#ifdef WGL_ARB_create_context
- PFNWGLCREATECONTEXTATTRIBSARBPROC wglCreateContextAttribs_ARB = (PFNWGLCREATECONTEXTATTRIBSARBPROC)wglGetProcAddress("wglCreateContextAttribsARB");
+ PFNWGLCREATECONTEXTATTRIBSARBPROC wglCreateContextAttribs_ARB = (PFNWGLCREATECONTEXTATTRIBSARBPROC)FunctionPointers[0];
if (wglCreateContextAttribs_ARB)
{
// with 3.0 all available profiles should be usable, higher versions impose restrictions
|