forked from Mirrorlandia_minetest/irrlicht
WGLManager: fix wglCreateContextAttribsARB not being used
This commit is contained in:
parent
4c0aff5aa8
commit
bd95662f03
@ -26,6 +26,7 @@ CWGLManager::CWGLManager()
|
|||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
setDebugName("CWGLManager");
|
setDebugName("CWGLManager");
|
||||||
#endif
|
#endif
|
||||||
|
memset(FunctionPointers, 0, sizeof(FunctionPointers));
|
||||||
}
|
}
|
||||||
|
|
||||||
CWGLManager::~CWGLManager()
|
CWGLManager::~CWGLManager()
|
||||||
@ -206,6 +207,9 @@ bool CWGLManager::initialize(const SIrrlichtCreationParameters& params, const SE
|
|||||||
os::Printer::log("WGL_extensions", wglExtensions);
|
os::Printer::log("WGL_extensions", wglExtensions);
|
||||||
#endif
|
#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
|
#ifdef WGL_ARB_pixel_format
|
||||||
PFNWGLCHOOSEPIXELFORMATARBPROC wglChoosePixelFormat_ARB = (PFNWGLCHOOSEPIXELFORMATARBPROC)wglGetProcAddress("wglChoosePixelFormatARB");
|
PFNWGLCHOOSEPIXELFORMATARBPROC wglChoosePixelFormat_ARB = (PFNWGLCHOOSEPIXELFORMATARBPROC)wglGetProcAddress("wglChoosePixelFormatARB");
|
||||||
if (pixel_format_supported && wglChoosePixelFormat_ARB)
|
if (pixel_format_supported && wglChoosePixelFormat_ARB)
|
||||||
@ -400,7 +404,7 @@ bool CWGLManager::generateContext()
|
|||||||
HGLRC hrc;
|
HGLRC hrc;
|
||||||
// create rendering context
|
// create rendering context
|
||||||
#ifdef WGL_ARB_create_context
|
#ifdef WGL_ARB_create_context
|
||||||
PFNWGLCREATECONTEXTATTRIBSARBPROC wglCreateContextAttribs_ARB = (PFNWGLCREATECONTEXTATTRIBSARBPROC)wglGetProcAddress("wglCreateContextAttribsARB");
|
PFNWGLCREATECONTEXTATTRIBSARBPROC wglCreateContextAttribs_ARB = (PFNWGLCREATECONTEXTATTRIBSARBPROC)FunctionPointers[0];
|
||||||
if (wglCreateContextAttribs_ARB)
|
if (wglCreateContextAttribs_ARB)
|
||||||
{
|
{
|
||||||
// with 3.0 all available profiles should be usable, higher versions impose restrictions
|
// with 3.0 all available profiles should be usable, higher versions impose restrictions
|
||||||
|
@ -65,6 +65,7 @@ namespace video
|
|||||||
s32 PixelFormat;
|
s32 PixelFormat;
|
||||||
PIXELFORMATDESCRIPTOR pfd;
|
PIXELFORMATDESCRIPTOR pfd;
|
||||||
ECOLOR_FORMAT ColorFormat;
|
ECOLOR_FORMAT ColorFormat;
|
||||||
|
void* FunctionPointers[1];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user