# glGetProgramParameter

Definition: | include pGUI.e include opengl.e integer res = glGetProgramParameter(integer program, pname, dflt=0)
Description: | return the value of a parameter from a program object program: Specifies the program object to be queried. pname: Specifies the object parameter. Accepted symbolic names are listed below. dflt: (optional) the value to return when an error occurs.
pwa/p2js: | Supported.
Notes: | The opengl.e wrapper returns a result whereas the C api requires the address of a result variable to be provided as the third parameter, instead of/containing a pre-poked default. On desktop/Phix, this wraps the C glGetProgramiv function (but with a different third argument). The following parameters are defined: GL_DELETE_STATUS returns GL_TRUE if program is currently flagged for deletion, and GL_FALSE otherwise. GL_LINK_STATUS returns GL_TRUE if the last link operation on program was successful, and GL_FALSE otherwise. GL_VALIDATE_STATUS returns GL_TRUE or if the last validation operation on program was successful, and GL_FALSE otherwise. GL_ATTACHED_SHADERS returns the number of shader objects attached to program. GL_ACTIVE_ATTRIBUTES returns the number of active attribute variables for program. GL_ACTIVE_ATTRIBUTE_MAX_LENGTH returns the length of the longest active attribute name for program, including the null termination character (i.e., the size of the character buffer required to store the longest attribute name). If no active attributes exist, 0 is returned. GL_ACTIVE_UNIFORMS returns the number of active uniform variables for program. GL_ACTIVE_UNIFORM_MAX_LENGTH returns the length of the longest active uniform variable name for program, including the null termination character (i.e., the size of the character buffer required to store the longest uniform variable name). If no active uniform variables exist, 0 is returned. Note that GL_INFO_LOG_LENGTH is not supported by WebGL and hence pwa/p2js, instead opengl.e uses it internally as part of the automatic buffer management. Technically it still works on the desktop and is permitted by the transpiler (since it is valid inside a platform()!=JS test), but generates an explicit runtime crash in pGUI.js. If an error is generated, the specified default is returned, but checking that glGetError() does not return GL_NO_ERROR should normally be used to verify an error did actually occur, unless an otherwise invalid default is provided.
Errors: | GL_INVALID_ENUM is generated if pname is not an accepted value. GL_INVALID_VALUE is generated if program is not a value generated by OpenGL. GL_INVALID_OPERATION is generated if program does not refer to a program object.
Associated Gets: | glGetActiveAttrib with argument program glGetActiveUniform with argument program glGetAttachedShaders with argument program glGetProgramInfoLog with argument program glIsProgram
See Also: | glAttachShader, glCreateProgram, glDeleteProgram, glGetShaderParameter, glLinkProgram, Z DEV See Also //glAttachShader, //glCreateProgram, //glDeleteProgram, //glGetShaderParameter, //glLinkProgram, glValidateProgram