GLFW打开OpenGL 3.2上下文,但Freeglut无法打开-为什么? [英] GLFW opens OpenGL 3.2 context but Freeglut can't - why?

查看:157
本文介绍了GLFW打开OpenGL 3.2上下文,但Freeglut无法打开-为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Mac上工作,已经编译并安装了FreeGlut,但似乎无法获得OpenGL 3.2上下文.但是,使用GLFW时我可以毫无问题地得到它. 因此,在GLFW中,此代码可以正常工作:

I am working on a Mac, I've got FreeGlut compiled and installed, but I can't seem to get the OpenGL 3.2 context with it. However, I can get it without any problem while using GLFW. So in GLFW, this code works perfectly fine:

    glfwOpenWindowHint(GLFW_OPENGL_VERSION_MAJOR, 3);
    glfwOpenWindowHint(GLFW_OPENGL_VERSION_MINOR, 2);
    glfwOpenWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
    glfwOpenWindow(500, 500, 8, 8, 8, 8, 24, 8, GLFW_WINDOW)

但是使用FreeGlut,此代码将失败(在glutCreateWindow上):

But with FreeGlut, this code fails(on glutCreateWindow):

glutInitContextVersion (3, 2);
glutInitContextProfile(GLUT_CORE_PROFILE);  
glutInitWindowSize (width, height); 
glutInitWindowPosition (300, 200);
int window = glutCreateWindow (argv[0]);

失败的错误是:

X Error of failed request:  BadRequest (invalid request code or no such operation)
  Major opcode of failed request:  34 (X_UngrabKey)
  Serial number of failed request:  29
  Current serial number in output stream:  29

我正在MacOS X 10.8 Mountain Lion上运行,具有Intel HD4000图形,已经安装XQuartz作为我的X11服务器,并且已经从源代码编译并安装了FreeGlut 2.8.

I am running on MacOS X 10.8 Mountain Lion, with Intel HD4000 graphics, having installed XQuartz as my X11 server,and having compiled and installed FreeGlut 2.8 from sources.

有人知道可能是什么问题吗?

Does anyone know what might be the issue?

推荐答案

在10.8和10.7中,如果在设置GL上下文时显式调用GL 3.2,则可以使用GL 3.2.苹果将​​其称为核心配置文件",以区别于GL 2.1的传统配置文件".

In 10.8 and 10.7 GL 3.2 is available if you explicitly call for it when setting up the GL context. Apple calls this the "Core Profile" to distinguish from the "Legacy Profile" which is GL 2.1.

我在OSX上遇到了Wine问题,它不支持OpenGL 3.2.我的理解是,X11服务器(Apple X11或XQuartz)当前未实现3.2支持,也没有切换到某个位置来启用它.可能出于兼容性方面的考虑,因为3.2配置文件将破坏某些

I ran into this issue with Wine on OSX, it does not support OpenGL 3.2. My understanding is that the X11 server (either Apple X11 or XQuartz) currently does not implement the 3.2 support, nor is there a switch to flip somewhere to enable it. It could be for compatibility concerns since 3.2 profile will break some existing GL applications

此帖子建议使用GLFW (或者如果还有这样的话,也许是苹果的GLUT.framework)

This post suggests using GLFW (or maybe Apple's GLUT.framework if there is still such a thing)

此页面解释了OSX上的GL堆栈并确认GLX的2.1问题.

This page explains the GL stack on OSX and confirms the 2.1 issue with GLX.

这篇关于GLFW打开OpenGL 3.2上下文,但Freeglut无法打开-为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆