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

Dam*_*ian 4 opengl macos xcode

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

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

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

在此输入图像描述

epa*_*tel 5

选择kCGLRendererGenericIDNSOpenGLPFARendererID创建pixelformat属性列表以启动context(initWithAttributes:)时.

NSOpenGLPFARendererID

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

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

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

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