CGL、AGL、OpenGL、NSOpenGL、CoreAnimation(CALayer)

发布于 2025-01-01 17:20:04 字数 668 浏览 3 评论 0原文

我试图了解 Mac 上与图层形式的 OpenGL 框架集成相关的一些内容。好吧,基本上当我想了解 OS X 中存在的 3D 技术以及哪一层是 OpenGL 的实际实现层时。

通过阅读苹果文档,以下是我到目前为止所理解的内容:

1.NSOpenGLContext 对象包装了一个低级的、特定于平台的 Core OpenGL (CGL) 上下文。

= 这清​​楚地表明 NSOpenGL 使用了 CGL。

2.AGL(Apple 图形库)API 是 Apple 在 Mac OS X 中实现 OpenGL 的一部分。

= 那么,AGL 和 CGL 有什么关系吗?

3.CGL(Core OpenGL)是Apple实现OpenGL的最低级编程接口。

= 这是否意味着标准 OpenGL API 只是 CGL 的包装?

4.CoreAnimation 似乎是 Core Graphics、Open-GL 和 Quick-time 的组合。但我不确定它下面用的是什么,我的意思是实际的实现层,还是CGL吗?

我并不完全清楚事情的真相。不过,我仍在阅读,并且我过去曾问过一些相关的问题,但知识不完整。

如果有人能分享他对事物的理解,我将非常感激。

I am trying to understand few things on Mac related to OpenGL framework integration in the form of layers. Well basically when I want to understand 3D technologies present in OS X and which layer is OpenGL's actual implentation layer.

From reading apple docs, below is what I have understood so far:

1.NSOpenGLContext object wraps a low-level, platform-specific Core OpenGL (CGL) context.

= This makes it clear that NSOpenGL makes use of CGL.

2.The AGL (Apple Graphics Library) API is part of the Apple implementation of OpenGL in Mac OS X.

= So, does AGL and CGL are related in any way?

3.CGL (Core OpenGL) is the lowest-level programming interface for the Apple implementation of OpenGL.

= Does it mean Standard OpenGL API's are just wrapper over CGL?

4.CoreAnimation seems to be combo of Core Graphics, Open-GL and Quick-time. But I am not sure what it uses underneath it, I mean actual implementation layer, is it again CGL?

Things are not completely clear to me. I am still reading though and I have asked somewhat related question in past but with incomplete knowledge.

I would really appreciate if someone can share his understanding on matter.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

冷情 2025-01-08 17:20:04

NSOpenGLContext、AGL 和 CGL 都是用于设置可绘制的 OpenGL 上下文的 API。

使用 NSOpenGLContext 除非你已经知道你有理由不这样做。

如果您正在编写 Carbon 应用程序或需要与 Mac OS 9 兼容(截至 2012 年,这基本上意味着:不需要),请使用 AGL。

AGL 和 NSOpenGLContext 都是在 CGL 之上实现的。然而,并非 CGL 的所有必需部分实际上都是公共 API。上次我检查时,CGL API 的唯一公共部分允许您创建全屏 OpenGL 上下文。如果您想要在窗口中使用 OpenGL,或者想要在 OpenGL 之上显示对话框或某些 NSView 的选项,您可能无法使用 CGL。

CoreAnimation 是一个(主要是 UI)动画框架;您可以使用 CoreAnimation,而无需直接使用 OpenGL。我自己从未使用过它,但我认为它还允许您为动画层创建 OpenGL 上下文。如果您已经有其他理由使用 CoreAnimation,或者您想以创造性的方式组合 OpenGL 图形和 Mac GUI 小部件,请使用它。

NSOpenGLContext, AGL and CGL are all APIs for setting up an OpenGL context you can draw into.

Use NSOpenGLContext unless you already know you have a reason not to.

Use AGL if you are writing a Carbon application or if you need compatibility with Mac OS 9 (As of 2012, that basically means: don't).

Both AGL and NSOpenGLContext are implemented on top of CGL. However, not all the necessary parts of CGL are actually public APIs. Last time I checked, the only public parts of the CGL API where the ones that allow you to create a fullscreen OpenGL context. If you want OpenGL in a window or you want the option of showing dialog boxes or some NSViews on top of your OpenGL, you probably can't use CGL.

CoreAnimation is a framework for (mostly UI) animations; you can use CoreAnimation without using OpenGL directly. I have never used it myself, but I assume it also allows you to create an OpenGL context for an animation layer. Use it if you already have other reasons to use CoreAnimation, or if you want to combine OpenGL graphics and Mac GUI widgets in creative ways.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文