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

查看:176
本文介绍了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 是作为GLKit框架的一部分,iOS 5.0中的新功能。 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天全站免登陆