1,
GLuint ShaderProgram = glCreateProgram();
GLuint ShaderObj = glCreateShader(ShaderType);
glShaderSource(ShaderObj, 1, p, Lengths);
glCompileShader(ShaderObj);
glAttachShader(ShaderProgram, ShaderObj);
glLinkProgram(ShaderProgram);
glUseProgram(ShaderProgram);
glDeleteShader(*iter);
glDeleteProgram(ShaderProgram);
2,
3,
4,
glUseProgram(ShaderProgram);
gScaleLocation = glGetUniformLocation(ShaderProgram, "gScale");
assert(gScaleLocation != 0xFFFFFFFF);
}
Sin(Scale)值在-1到1之间摆动,Position.x, Position.y在[-1,1]缩放,可以看三角形缩放和上下左右摆动。
应为左右两点对称的只能看见左右缩放看不出来左右摆动。