我有一个存储在String值中的着色器:
原文链接:https://www.f2er.com/swift/319014.htmlvar myShader = " attribute vec4 a_position;" + " void main() {" + " gl_Position = a_position;" + " }" glShaderSource(shader,GLsizei(1),myShader,nil)
函数glShaderSource具有绑定签名:
func glShaderSource(shader: GLuint,count: GLsizei,string: UnsafePointer<UnsafePointer<GLchar>>,length: UnsafePointer<GLint>)
当我尝试直接将着色器String传递给glShaderSource时,我收到错误消息:
'String' is not convertible to 'UnsafePointer<UnsafePointer<GLchar>>'
如何正确传递String? (xCode版本6.1(6A1052d))