GLKView 和 EAGLView 有什么区别? [英] What's the difference between GLKView and EAGLView?

查看:13
本文介绍了GLKView 和 EAGLView 有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经看到在 iOS 应用程序中使用了 EAGLView 和 GLKView.它们有什么区别?

I've seen both EAGLView and GLKView used in iOS applications. What's the difference between them?

推荐答案

这两个类都与 OpenGL ES 相关,但实际上只有一个是由 Apple 作为 iOS SDK 的一部分提供的.

Both of these classes are related to OpenGL ES, but only one of them is actually supplied by Apple as part of the iOS SDK.

EAGLView 不是 Cocoa Touch 框架提供的类.在 Apple 的 OpenGL ES 模板和示例代码中,他们使用此名称创建了托管 OpenGL ES 内容的类.其他人已将这些课程复制并粘贴到他们编写的有关该主题的教程中.通常,所有具有此名称的类的一个共同点是它们覆盖了 +layerClass 方法以返回 [CAEAGLLayer 类],表明这些视图将承载支持层中的 OpenGL ES 内容.

EAGLView is not a class provided with the Cocoa Touch frameworks. In Apple's OpenGL ES templates and sample code, they've created classes with this name that host OpenGL ES content. Others have copied and pasted these classes in the tutorials they've written about the subject. Generally, the one element all of the classes with this name have in common is that they override the +layerClass method to return [CAEAGLLayer class], indicating that these views will host OpenGL ES content within their backing layer.

GLKView 是 iOS 5.0 中的新功能,是 GLKit 框架的一部分.GLKit 旨在通过提供 GLKView 等辅助类来简化显示 OpenGL ES 材质所需的一些设置.GLKView 为您处理帧缓冲区和渲染缓冲区的设置,以及您通常必须为其编写代码的一些其他任务.

GLKView is new in iOS 5.0 as part of the GLKit framework. GLKit aims to simplify some of the setup required for displaying OpenGL ES material by providing helper classes like GLKView. GLKView handles setup of framebuffers and render buffers for you, as well as some of the other tasks you normally have to write code for.

您可能不会在教程中看到这个类被大量使用,因为其中许多是在 iOS 5.0 之前编写的,但这是一个方便的帮助类,可以简化 iOS OpenGL ES 渲染.

You might not see this class being used much in tutorials, given that many of them were written before iOS 5.0, but this is a handy helper class that can simplify iOS OpenGL ES rendering.

这篇关于GLKView 和 EAGLView 有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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