在Xcode中为mac开发OpenGL。我可以强制软件渲染吗?

时间:2011-04-09 18:53:19

标签: xcode macos opengl

我正在将一个OpenGL游戏从iPhone移植到Mac,并且纹理被破坏有问题。我想这是一个记忆问题。

事情是我现在已经将mac崩溃了3次(在游戏启动时随机发生),因此调试它变得困难。

有什么方法可以强制进行软件渲染吗?

enter image description here

1 个答案:

答案 0 :(得分:5)

在创建pixelformat属性列表以启动上下文(initWithAttributes:)时,选择kCGLRendererGenericIDNSOpenGLPFARendererID

  

<强> NSOpenGLPFARendererID

     

值是非负渲染器ID号。首选匹配指定ID的OpenGL渲染器。选择特定渲染器的常量在OpenGL框架的CGLRenderers.h头中提供。值得注意的是选择Apple软件渲染器的kCGLRendererGenericID。其他常量为特定硬件供应商选择渲染器。

注意!我刚看到kCGLRendererGenericID已被弃用,要使用的是kCGLRendererAppleSWID

另一个提示是使用OpenGL Profiler启动应用程序。见这里

http://lists.apple.com/archives/quartzcomposer-dev/2010/Jun/msg00090.html

相关问题