[OpenGL] Request a forward compat context in Citra-Qt

This should fix it on OS X, which requires this flag. Also requests a
core context on all platforms in Citra-GLFW, for consistency.
This commit is contained in:
Yuri Kunde Schlesner 2014-08-30 18:17:47 -03:00
parent f1f381aec6
commit 0e0cccf0e2
2 changed files with 3 additions and 6 deletions

View file

@ -27,12 +27,9 @@ EmuWindow_GLFW::EmuWindow_GLFW() {
} }
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2); glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
#if EMU_PLATFORM == PLATFORM_MACOSX
// GLFW on OSX requires these window hints to be set to create a 3.2+ GL context. // GLFW on OSX requires these window hints to be set to create a 3.2+ GL context.
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
#endif
m_render_window = glfwCreateWindow(VideoCore::kScreenTopWidth, m_render_window = glfwCreateWindow(VideoCore::kScreenTopWidth,
(VideoCore::kScreenTopHeight + VideoCore::kScreenBottomHeight), (VideoCore::kScreenTopHeight + VideoCore::kScreenBottomHeight),

View file

@ -113,10 +113,10 @@ GRenderWindow::GRenderWindow(QWidget* parent) : QWidget(parent), emu_thread(this
{ {
// TODO: One of these flags might be interesting: WA_OpaquePaintEvent, WA_NoBackground, WA_DontShowOnScreen, WA_DeleteOnClose // TODO: One of these flags might be interesting: WA_OpaquePaintEvent, WA_NoBackground, WA_DontShowOnScreen, WA_DeleteOnClose
QGLFormat fmt; QGLFormat fmt;
fmt.setProfile(QGLFormat::CoreProfile);
fmt.setVersion(3,2); fmt.setVersion(3,2);
fmt.setSampleBuffers(true); fmt.setProfile(QGLFormat::CoreProfile);
fmt.setSamples(4); // Requests a forward-compatible context, which is required to get a 3.2+ context on OS X
fmt.setOption(QGL::NoDeprecatedFunctions);
child = new GGLWidgetInternal(fmt, this); child = new GGLWidgetInternal(fmt, this);
QBoxLayout* layout = new QHBoxLayout(this); QBoxLayout* layout = new QHBoxLayout(this);