From c963d0735ca2ee0c5981d46f3113debca1465910 Mon Sep 17 00:00:00 2001 From: Aurora Date: Sat, 23 Nov 2024 18:05:33 +0000 Subject: [PATCH] fixed null termination on shader compilation --- gl41core-cube/cube.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gl41core-cube/cube.go b/gl41core-cube/cube.go index 0f32200..7867a66 100644 --- a/gl41core-cube/cube.go +++ b/gl41core-cube/cube.go @@ -177,7 +177,7 @@ func newProgram(vertexShaderSource, fragmentShaderSource string) (uint32, error) func compileShader(source string, shaderType uint32) (uint32, error) { shader := gl.CreateShader(shaderType) - csources, free := gl.Strs(source) + csources, free := gl.Strs(source + "\x00") gl.ShaderSource(shader, 1, csources, nil) free() gl.CompileShader(shader) @@ -251,7 +251,7 @@ void main() { fragTexCoord = vertTexCoord; gl_Position = projection * camera * model * vec4(vert, 1); } -` + "\x00" +` var fragmentShader = ` #version 330 @@ -265,7 +265,7 @@ out vec4 outputColor; void main() { outputColor = texture(tex, fragTexCoord); } -` + "\x00" +` var cubeVertices = []float32{ // X, Y, Z, U, V