使用OpenGL在Mac OSX El Capitan上渲染毛刺 [英] Rendering Glitch on Mac OSX El Capitan with OpenGL

查看:159
本文介绍了使用OpenGL在Mac OSX El Capitan上渲染毛刺的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用SDL 1.2 + OpenGL 1.1为OSX创建了一个网球游戏.

I created a tennis game for OSX using SDL 1.2 + OpenGL 1.1 .

一切正常,直到El Capitan.现在,一些纹理无法正确显示.

Everything was ok till El Capitan. Now, a few textures aren't displayed correctly.

球场白线现在是黑色;播放器的材质都不好;左侧的能量条全为黑色:

The court white lines are now black ; the player textures are all bad ; the energy bars on the left are all black:

图标上的白线不正常.高亮显示的图标上的彩虹纹理也不是:

The white lines on the icons aren't normal. The rainbow texture on the highlighted icon isn't either:

游戏通常的外观:

错误的纹理是:

  • 玩家:他们使用RGBA使用不同的材质在游戏中重新创建
  • 白线(现在为黑色):正常的RGBA纹理
  • 能量条(在左侧):正常的RGBA纹理
  • 其他一些GUI元素,但不是全部:大多是普通的RGBA纹理

此外,只有AppStore版本的游戏才会出现这些故障. 我从我的网站发布的版本似乎没有故障(=> http://www.managames.com/predownload_en.php?f=TennisElbowMac_sto.zip )

Moreover, it's only the AppStore version of the game that gets these glitches. The version I distribute from my website seems to be glitch free ( => http://www.managames.com/predownload_en.php?f=TennisElbowMac_sto.zip )

我完全不知道发生了什么事.我知道El Capitan只是在OS渲染方式上带来了很大的变化,但我不知道在哪里看,甚至不知道要修复什么.

I'm totally puzzled by what's going on. I know El Capitan just brought a big change in the way the OS renders things, but I have no idea where to look and even less what to fix.

似乎它只触摸RGBA纹理,但由于大多数GUI元素仍能正确显示,因此并非全部.

It seems it only touches RGBA textures, but not all of them as most GUI elements are still correctly displayed.

因此,在此先感谢您提供的任何提示!

So thanks in advance for any tips you may have !

推荐答案

感谢Sidney Markowitz在此线程的帮助=>

Thanks to the help of Sidney Markowitz from this thread => https://lists.gnu.org/archive/html/enigma-devel/2015-10/msg00001.html , I figured a solution : replacing SDL_Image 1.2.12 version by 1.2.10 version.

如果我做对了,发现1.2.10带有旧的通用代码,这在AppStore中是不允许的,因此使用此版本提交App可能会被拒绝.因此,我将尝试仅使用x86代码重新编译它,这应该可以解决问题.

If I got this right, the catch is that 1.2.10 comes with old universal code which is not allowed on the AppStore, so submitting an App with this version would likely end in a rejection. So I'm going to try to recompile it with only x86 code, that should likely do the trick.

我没有使用重新编译,而是使用了Lipo( http://www.manpages.info /macosx/lipo.1.html ),就像这样:

Instead of recompiling, I just used Lipo ( http://www.manpages.info/macosx/lipo.1.html ), like this :

lipo-删除ppc-输出〜/Documents/SDL_image/Library/Frameworks/SDL_image.framework/Versions/A/SDL_image

lipo -remove ppc -output ~/Documents/SDL_image /Library/Frameworks/SDL_image.framework/Versions/A/SDL_image

然后将〜/Documents/SDL_image"移回至"/Library/Frameworks/SDL_image.framework/Versions/A/".最后,我编辑了它的info.plist,以修复Bundle ID(需要2个点),以便可以在AppStore上发布.

And then moved back "~/Documents/SDL_image" to "/Library/Frameworks/SDL_image.framework/Versions/A/" . And finally I edited its info.plist to fix the Bundle ID (needs 2 dots in it) so publishing on the AppStore could work.

再次感谢Sidney Markowitz提供的Lipo提示! :-)

Thanks again to Sidney Markowitz for the Lipo hint ! :-)

新版本已被Apple拒绝,因为SDL_image 1.2.10使用了不推荐使用的CGDataProviderCreate API.该代码包含"#ifdef"以使用较新的替代品,因此我将不得不重新编译而不是使用Lipo,但恐怕此较新的替代品是OSX El Capitan上实际出现故障的原因.

New version has been rejected by Apple, because SDL_image 1.2.10 uses a deprecated CGDataProviderCreate API. The code contains a "#ifdef" to use a newer replacement, so I'll have to recompile it instead of using Lipo, but I'm afraid this newer replacement is the actual source of the glitch on OSX El Capitan.

重新编译SDL_image 1.2.10可以工作,但不是那样,我不得不将安装文件夹更改为@rpath和其他一些参数,然后在AppStore上成功接受了该文件.

Recompiling SDL_image 1.2.10 works, but not as it, I had to change the installation folder to @rpath and a few other parameters and then it was successfully accepted on the AppStore.

这篇关于使用OpenGL在Mac OSX El Capitan上渲染毛刺的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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