mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-07 03:13:49 +00:00
Request core GL profile.
This commit is contained in:
parent
a625225323
commit
c1bba2afe6
|
@ -55,11 +55,10 @@ void DisplayWindowMupen64plus::_setAttributes()
|
||||||
#elif defined(GLES3_1)
|
#elif defined(GLES3_1)
|
||||||
CoreVideo_GL_SetAttribute(M64P_GL_CONTEXT_MAJOR_VERSION, 3);
|
CoreVideo_GL_SetAttribute(M64P_GL_CONTEXT_MAJOR_VERSION, 3);
|
||||||
CoreVideo_GL_SetAttribute(M64P_GL_CONTEXT_MINOR_VERSION, 1);
|
CoreVideo_GL_SetAttribute(M64P_GL_CONTEXT_MINOR_VERSION, 1);
|
||||||
#elif defined(OS_MAC_OS_X)
|
|
||||||
CoreVideo_GL_SetAttribute(M64P_GL_CONTEXT_MAJOR_VERSION, 3);
|
|
||||||
CoreVideo_GL_SetAttribute(M64P_GL_CONTEXT_MINOR_VERSION, 2);
|
|
||||||
#else
|
#else
|
||||||
// Do nothing
|
CoreVideo_GL_SetAttribute(M64P_GL_CONTEXT_PROFILE_MASK, M64P_GL_CONTEXT_PROFILE_CORE);
|
||||||
|
CoreVideo_GL_SetAttribute(M64P_GL_CONTEXT_MAJOR_VERSION, 3);
|
||||||
|
CoreVideo_GL_SetAttribute(M64P_GL_CONTEXT_MINOR_VERSION, 3);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef GLES2
|
#ifndef GLES2
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <Graphics/OpenGLContext/GLFunctions.h>
|
#include <Graphics/OpenGLContext/GLFunctions.h>
|
||||||
|
#include <GL/wglext.h>
|
||||||
#include <windows/GLideN64_Windows.h>
|
#include <windows/GLideN64_Windows.h>
|
||||||
#include <GLideN64.h>
|
#include <GLideN64.h>
|
||||||
#include <Config.h>
|
#include <Config.h>
|
||||||
|
@ -91,6 +92,39 @@ bool DisplayWindowWindows::_start()
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PFNWGLGETEXTENSIONSSTRINGARBPROC wglGetExtensionsStringARB =
|
||||||
|
(PFNWGLGETEXTENSIONSSTRINGARBPROC)wglGetProcAddress("wglGetExtensionsStringARB");
|
||||||
|
|
||||||
|
if (wglGetExtensionsStringARB != NULL) {
|
||||||
|
const char * wglextensions = wglGetExtensionsStringARB(hDC);
|
||||||
|
|
||||||
|
if (strstr(wglextensions, "WGL_ARB_create_context") != nullptr &&
|
||||||
|
strstr(wglextensions, "WGL_ARB_create_context_profile") != nullptr) {
|
||||||
|
PFNWGLCREATECONTEXTATTRIBSARBPROC wglCreateContextAttribsARB =
|
||||||
|
(PFNWGLCREATECONTEXTATTRIBSARBPROC)wglGetProcAddress("wglCreateContextAttribsARB");
|
||||||
|
|
||||||
|
GLint majorVersion = 0;
|
||||||
|
glGetIntegerv(GL_MAJOR_VERSION, &majorVersion);
|
||||||
|
GLint minorVersion = 0;
|
||||||
|
glGetIntegerv(GL_MINOR_VERSION, &minorVersion);
|
||||||
|
|
||||||
|
const int attribList[] =
|
||||||
|
{
|
||||||
|
WGL_CONTEXT_MAJOR_VERSION_ARB, majorVersion,
|
||||||
|
WGL_CONTEXT_MINOR_VERSION_ARB, minorVersion,
|
||||||
|
WGL_CONTEXT_PROFILE_MASK_ARB, WGL_CONTEXT_CORE_PROFILE_BIT_ARB,
|
||||||
|
0 //End
|
||||||
|
};
|
||||||
|
|
||||||
|
HGLRC coreHrc = wglCreateContextAttribsARB(hDC, 0, attribList);
|
||||||
|
if (coreHrc != NULL) {
|
||||||
|
wglDeleteContext(hRC);
|
||||||
|
wglMakeCurrent(hDC, coreHrc);
|
||||||
|
hRC = coreHrc;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return _resizeWindow();
|
return _resizeWindow();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user