Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions gl41core-cube/cube.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -251,7 +251,7 @@ void main() {
fragTexCoord = vertTexCoord;
gl_Position = projection * camera * model * vec4(vert, 1);
}
` + "\x00"
`

var fragmentShader = `
#version 330
Expand All @@ -265,7 +265,7 @@ out vec4 outputColor;
void main() {
outputColor = texture(tex, fragTexCoord);
}
` + "\x00"
`

var cubeVertices = []float32{
// X, Y, Z, U, V
Expand Down