如何在Mac OS X Snow Leopard应用程序的OpenGL中加载IOSurface [英] How to load IOSurface in OpenGL for Mac OS X Snow Leopard application

查看:286
本文介绍了如何在Mac OS X Snow Leopard应用程序的OpenGL中加载IOSurface的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

苹果在10.6 Mac OS X公司更新中增加了新的IOSurface框架。由于这个框架相对较新,我还没有找到关于如何正确使用它的很多需要文档。



我想知道StackOverflow上是否有人可以帮助我IOSurface的用法。



无论如何,这是我想要做的。现在我的应用程序非常简单,所以我可以熟悉IOSurfaces。所以基本上,我想将一个图像加载到IOSurface纹理中并显示在自定义的OpenGLView中。这就是我现在要做的。



为了让这个更简单,我只在IOSurface中加载一个常量颜色。我的主要目标是在一个自定义的OpenGL视图中创建一个IOSurface引用并显示。



请帮助我
-IOSurface声明语句
将数据加载到IOSurface
中,并在OpenGL中绘制IOSurface的语法。
$ b

非常感谢。



ps



IOSurface就像是一个内存管理器,它可以在应用程序之间传递图形数据,或者是一行内容。

我试过Google IOSurface。而最有用的网站是

http://cocoadhoc.blogspot.com/2009/09/hidden-gems-of-snow-leopard-iosurface.html



然而,当我尝试编译示例代码时,我有一个编译器错误,指出QTVisualContextRef和其他未声明的QuickTime变量。我通过自动更新获得了最新版本的Quick Time。

解决方案

IOSurface API与Core Video的CVPixelBuffer非常相似,记录在案,所以你可以先看看 CVPixelBuffer文档并与IOSurfaceAPI.h进行比较。



将OpenGL纹理绑定到IOSurface,请参阅< OpenGL / CGLIOSurface.h> 中定义的CGLTexImageIOSurface2D函数。


Apple added the new IOSurface framework as part of the 10.6 Mac OS X firm update. Since this framework relatively new, I haven't found the much need documentation on how to properly use this.

I was wondering if there anyone on StackOverflow that can assist me with IOSurface usage.

Anyways, this is what I want to do. Right now my application is very simple so that I can become familiar with IOSurfaces. So essentially, I would want to load up an image into an IOSurface texture and display in a custom OpenGLView. That's all I am aiming for at this point.

To make this more simple, I just load one constant color in the IOSurface. My main objective at this point is to create an IOSurface reference and display in a custom OpenGL view.

Please help me with -IOSurface declaration statements -Loading data into the IOSurface -and the syntax for drawing the IOSurface in OpenGL.

Much appreciated.

p.s.

IOSurface is like a memory manager that passes graphic data between applications or something a long the line of that.

I have tried Google IOSurface. And the most helpful site is

http://cocoadhoc.blogspot.com/2009/09/hidden-gems-of-snow-leopard-iosurface.html

However, when I tried compile the example code, I have a compiler error stating that QTVisualContextRef and other QuickTime variables undeclared. I have the latest version of Quick Time through the automatic update.

解决方案

The IOSurface API is quite similar to Core Video's CVPixelBuffer, which is documented, so you could start by looking at the CVPixelBuffer documentation and comparing with IOSurfaceAPI.h.

To bind an OpenGL texture to an IOSurface, see the CGLTexImageIOSurface2D function, which is defined in <OpenGL/CGLIOSurface.h>.

这篇关于如何在Mac OS X Snow Leopard应用程序的OpenGL中加载IOSurface的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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