我可以混合OpenglES与iPhone应用程序上的标准Cocoa小部件吗? [英] Can I mix OpenglES with standard Cocoa widgets on an iPhone app?

查看:96
本文介绍了我可以混合OpenglES与iPhone应用程序上的标准Cocoa小部件吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在这种情况下,可以看到一些例子。

In case this is possible, it would be nice to see some examples!

谢谢,
rui

Thanks, rui

推荐答案

这个问题询问一些非常相似的东西,正如我所说的那样,OpenGL ES内容与UIKit控件并存是微不足道的。 OpenGL ES内容存在于一个CAEAGLLayer中,该CAEAGLLayer返回一个UIView,它是正常视图层次结构的一部分。你可以轻松地覆盖其他UIViews上面。

This question asks something very similar, and as I state there it's trivial to have OpenGL ES content coexist with UIKit controls. The OpenGL ES content lives within a CAEAGLLayer that backs a UIView, which is part of the normal view hierarchy. You can easily overlay other UIViews on top of it.

有关示例,您可以查看我的

For an example of this, you can look at the source code to my Molecules application, where I place two UIButtons on top of my OpenGL ES view.

在我的基准测试中,你失去了〜1-5%的分辨率,的OpenGL帧速率,通过在OpenGL ES视图之上放置其他视图,这不是太可怕。你不想做的是让你的OpenGL ES上下文不透明,并尝试覆盖其他视图元素,因为你会看到一个显着的渲染速度下降。

In my benchmarks, you lose ~1-5% of your OpenGL framerate by placing other views on top of the OpenGL ES view, which is not too terrible. What you don't want to do is make your OpenGL ES context non-opaque and try to overlay that on top of other view elements, because you'll see a significant drop in rendering speed then.

这篇关于我可以混合OpenglES与iPhone应用程序上的标准Cocoa小部件吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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