From 5b1a50ecb7d1dd1b3833e6239dcae5dec350c0c2 Mon Sep 17 00:00:00 2001 From: Sergey Lipskiy Date: Thu, 14 May 2015 11:45:41 +0600 Subject: [PATCH] Set OpenGL context major and minor version in OGLVideoMupenPlus::_setAttributes() --- src/mupenplus/OpenGL_mupenplus.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/mupenplus/OpenGL_mupenplus.cpp b/src/mupenplus/OpenGL_mupenplus.cpp index 8549760a..7bf0d894 100644 --- a/src/mupenplus/OpenGL_mupenplus.cpp +++ b/src/mupenplus/OpenGL_mupenplus.cpp @@ -38,6 +38,21 @@ OGLVideo & OGLVideo::get() void OGLVideoMupenPlus::_setAttributes() { +#ifdef GLES2 + CoreVideo_GL_SetAttribute(M64P_GL_CONTEXT_MAJOR_VERSION, 2); + CoreVideo_GL_SetAttribute(M64P_GL_CONTEXT_MINOR_VERSION, 0); +#elif defined(GLES3) + CoreVideo_GL_SetAttribute(M64P_GL_CONTEXT_MAJOR_VERSION, 3); + CoreVideo_GL_SetAttribute(M64P_GL_CONTEXT_MINOR_VERSION, 0); +#elif defined(GLES3_1) + CoreVideo_GL_SetAttribute(M64P_GL_CONTEXT_MAJOR_VERSION, 3); + 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 + // Do nothing +#endif CoreVideo_GL_SetAttribute(M64P_GL_DOUBLEBUFFER, 1); CoreVideo_GL_SetAttribute(M64P_GL_SWAP_CONTROL, config.video.verticalSync); CoreVideo_GL_SetAttribute(M64P_GL_BUFFER_SIZE, 32);