Graphics|EngineDev|GameDev|2D&3D Art
GLuint glCreateProgram(
void
);
GLuint glCreateShader(GLenum shaderType);
glShaderSource( GLuint shader,
GLsizei count,
const
GLchar ** string,
GLint * length);
glCompileShader(GLuint shader);
glGetShaderiv(GLuint shader,
GLenum pname,
GLint * params);
glGetShaderInfoLog(GLuint shader,
GLsizei maxLength,
GLsizei * length,
GLchar * infoLog);
glAttachShader( GLuint program,
GLuint shader);
glBindAttribLocation( GLuint program,
GLuint index,
GLchar *name);
attribute vec4 position;
attribute vec4 color;
varying vec4 colorVarying;
uniform
float
translate;
main()
{
gl_Position = position;
colorVarying = color;
}
// bind attribute locations
// this needs to be done prior to linking
glBindAttribLocation(program, ATTRIB_VERTEX,
"position"
glBindAttribLocation(program, ATTRIB_COLOR,
"color"
glLinkProgram(GLuint program);
glGetProgramiv( GLuint program,
GLint *params);
glGetProgramInfoLog( GLuint program,
GLsizei *length,
GLchar *infoLog);
glValidateProgram( GLuint program);
GLint glGetUniformLocation( GLuint program,
GLchar * name);
glDeleteShader(GLuint shader);
glUseProgram( GLuint program);
Powered by: C++博客 Copyright © 情绝格调(fresmaster)