Mac上的CGL vs OpenGL [英] CGL vs OpenGL on Mac

查看:114
本文介绍了Mac上的CGL vs OpenGL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试弄清

I am trying to figure out the relationship between CGL and OpenGL on Mac platform.

更具体地讲上下文.他们共享上下文吗?如果是,怎么办?请给我链接到一些相关示例.

More specifically about the context. Do they share context? If yes, how? Please give me a link to some related examples.

如果否,那么在使用OpenGL的Core Animation应用程序中是否存在两个上下文?

If no, then are there two contexts working in Core Animation applications which make use of OpenGL?

我对Mac使用OpenGL感到非常困惑.有人可以澄清吗?

I am very confused by the use of OpenGL by Mac. Can somebody clarify?

推荐答案

CGL设置了适合OpenGL渲染的特定于设备的上下文.分别与Windows和X上的wgl和xgl进行比较. CGL了解如何查询图形硬件的像素格式,然后如何设置和配置上下文(例如,双缓冲或单缓冲,什么分辨率的深度,模板,累积缓冲区等).但是它不提供在该上下文中进行绘制的功能.使用CGL创建上下文后,将其设置为当前上下文,然后可以调用OpenGL在该上下文中进行渲染.

CGL sets up device specific contexts suitable for OpenGL to render to. Compare to wgl and xgl on Windows and X respectively. CGL understands how to query the graphics hardware for its pixel format, and then how to set up and configure a context (e.g. double-buffered or single-buffered, what resolution depth, stencil, accumulation buffer, etc). But it doesn't provide functions to draw in that context. Once you have created the context with CGL, you make it current, and then you can call OpenGL to render in that context.

在Core Graphics(不要将其与CGL混淆)中,上下文初始化和绘制到上下文均由同一框架处理.但是,由于OpenGL是一个开放标准,并且设计为跨平台的,因此渲染功能和设备上下文功能已抽象到单独的框架中.

In Core Graphics (do not confuse it with CGL), both context initialization and drawing into the context are handled by the same framework. But because OpenGL is an open standard and designed to be cross-platform, the rendering functionality and the device context functionality have been abstracted into separate frameworks.

这篇关于Mac上的CGL vs OpenGL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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