If you've found something you believe is in error, please send us a note using this link.
You can find erratas for previous versions here.
3*sizeof(GLfloat). The correct specification is 6*sizeof(GLfloat). (reported by Richard Chaney)
The width and height parameters give the dimesions of the texture image; border indicates the width of the border, which is either 0 (no border) or 1. Both width and height must have the form 2m + 2b, where m is a non-negative integer (which can have a different value for width than for height) and b is the value of border. The maximum size of a texture map depends on the implementation of OpenGL, but it must be at least 64 × 64 (or 66 × 66 with borders). For OpenGL 2.0 implementations, the power-of-two dimension requirement has been eliminated.The same clarification should also be added to the other glCopyTexImage2D() (page 379), glTexImage1D() (page 385), glCopyTexImage1D() (page 386), glTexImage3D() (page 388) function descriptions, as well as for the glCompressedTexImage1D(), glCompressedTexImage2D(), and the glCompressedTexImage3D() function descriptions (page 393). (reported by Paul Martz)
The shader area indicates the functions of the vertex processing pipeline that are replaced by the vertex shader.(reported by Kouichi Matsuda)
Deletes shader. If shader is currently linked to one or more active shader programs, the object is tagged for deletion, and only deleted once the shader object is no longer used by any shader programs.
†In ANSI C, concatenated ASCII strings, not separated by commas, will be combined into a single string, aligned contigiously in memory. The original example used that technique, but was probably not as clear as the updated declaration below, which uses commas to create an array of strings. The side effect of the comma-delimited array is that you need to keep an accurate count of its size to pass into glShaderSource(). To that end, we use a macro , NumberOfLines() to count the number of elements in the array.
The correct implementation is (with changes highlighted in red):
GLuint shader, program; GLint compiled, linked; #define NumberOfLines(x) (sizeof(x)/sizeof(x[0])) const GLchar* shaderSrc[] = { “void main()”, “{“, “ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;”, “}” }; shader = glCreateShader(GL_VERTEX_SHADER); glShaderSource(shader, NumberOfLines(shaderSrc), shaderSrc, NULL); glCompileShader(shader); glGetShaderiv(shader, GL_COMPILE_STATUS, &compiled ); if (!compiled) { GLint length; GLchar log; glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &length ); log = (GLchar*) malloc(length); glGetShaderInfoLog(shader, length, &length, log); fprintf( stderr, "compile log = '%s'\n", log ); } program = glCreateProgram(); glAttachShader(program, shader); glLinkProgram(program); glGetProgramiv(program, GL_LINK_STATUS, &linked ); if (linked) { glUseProgram( vertPgm ); } else { GLint length; GLchar log; glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &length ); log = (GLchar*) malloc(length); glGetShaderInfoLog(shader, length, &length, log); fprintf( stderr, "link log = '%s'\n", log ); }
vec3 column1 = vec3( 4.0, 0.0, 0.0 ); vec3 column2 = vec3( 0.0, 4.0, 0.0 ); ...
and for the declaration of the initialized matrix
mat3 m = mat3( column1, column2, column3 );
(reported by William Hesse)
For arrays of uniform variables, the index of the first element of the array may be queried either by specifying the only the array name (for example, "arrayName"), or by specifying the index to the first element of the array (as in "arrayName[0]").(reported by Kouichi Matsuda)
Each client-side vertex array needs to be enabled.(reported by Kouichi Matsuda)