【发布时间】:2016-11-02 18:33:18
【问题描述】:
我有一个简单的 Swift 命令行 MacOS 应用程序,我正在努力设置 EAGLContext:
let openGLContext = EAGLContext(API: .OpenGLES3)
let context = CIContext(EAGLContext: openGLContext)
上面的代码给了我:
Use of unresolved identifier 'EAGLContext'
无论我加载什么模块:
import CoreImage
import OpenGL
import QuartzCore
import GLKit
现在的问题是:CIContext 默认使用 OpenGL 渲染吗?
当我在没有任何选项的情况下初始化一个新的CIContext 时:
let context = CIContext()
并将环境变量 CI_PRINT_TREE 设置为 1 控制台输出给我:
initial graph image_get_cgimage (opengl context 1 frame 1)
^^^^^^^^^^^^^^^^^^^^^^^^
所以它确实在 GPU 上下文中处理我的过滤器,对吧?有没有办法显式设置 GPU 渲染或者 GPU 是默认上下文?
【问题讨论】:
标签: swift swift3 core-image