Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reordered null at the end of strings for clarity. #87

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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