【问题标题】:Use FreeGLUT for OpenGL xCode projects on MacOS Mavericks在 MacOS Mavericks 上将 FreeGLUT 用于 OpenGL xCode 项目
【发布时间】:2014-10-02 22:09:25
【问题描述】:

我正在尝试在 MacOS X Mavericks 上制作 OpenGL 应用程序。为此,我使用 Glew、FreeGLUT(在项目设置中添加适当的搜索路径并添加链接器标志)以及 MacOS OpenGL 框架。

问题是,一旦我到达glutCreateWindow,程序就会崩溃并出现以下错误:

  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

正如我所看到的on another post 这可能是因为窗口服务器,但我已经安装了很多人建议的 XQuartz 2.7.7,但我仍然无法安装。

有没有人尝试过在类似情况下使用 FreeGLUT?

【问题讨论】:

    标签: xcode macos opengl x11 freeglut


    【解决方案1】:

    我通过修改我的代码解决了这个问题:glutInitContextVersion(2, 1); 原因是 X11 在 OS X 上不支持高于 2.1 的 OpenGL。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多