-
Notifications
You must be signed in to change notification settings - Fork 16
String handling
chsc edited this page Jan 15, 2012
·
1 revision
Sample:
vertexShader := gl.CreateShader(gl.VERTEX_SHADER)
vertexShaderGLStrs := gl.GLStringArray(vertexShaderStr1, vertexShaderStr2, ...)
defer gl.GLStringArrayFree(vertexShaderGLStrs)
gl.ShaderSource(vertexShader, len(vertexShaderGLStrs), &vertexShaderGLStrs[0], nil)
gl.CompileShader(vertexShader)
Sample:
var length gl.Int
gl.GetShaderiv(fragmentShader, gl.INFO_LOG_LENGTH, &length)
glString := gl.GLStringAlloc(gl.Sizei(length))
defer gl.GLStringFree(glString)
gl.GetShaderInfoLog(fragmentShader, gl.Sizei(length), nil, glString)
fmt.Println("shader log: ", gl.GoString(glString))
Maybe future versions of GoGL will have a more convenient interface for some special functions. Any idea is appreciated.