(Draft only, not sorted)
2.5 GL error message
GL can only detect part of the error conditions. This is because in many error detection cases, it will adversely affect the error-free program.
Command for getting error information:
Enum geterror (void );
Each detected error is assigned a numerical code. When an error occurs, an identifier is set and the encoding is recorded. If another error occurs, the encoding of the record is not affected. When the geterror function is called, the encoding is returned and the identifier is cleared. This encoding can be recorded for subsequent errors. If no _ error is returned when geterror is called, it means that no error occurs after the first call (or after GL initialization ).
Multiple ID pairs are used to allow distribution. In this case, until all non-no_error results are returned, otherwise, after geterror is called, subsequent calls return non-0 values of unique code pairs (in undefined order ). If no more non-no_error occurs, all the identifiers are enclosed. This mechanism requires positive bit to identify the pair value and integer. In the initialization status, all identifiers are set to no_error.
Table 2.3 contains all Gl errors. After an error identifier is set, except for an out_of memory error, the results of the GL operation are not defined. In other cases, errors do not affect the GL status or frame cache content. If a generated command returns a value, the value is 0. If the generated command modifies the value through the pointer parameter, these values will not change. These error semantics only apply to GL errors and are not used for system errors such as memory access errors. These actions are only the current actions. The operation of the wrong GL will also change.
Three error generation conditions are hidden in the description of the GL command.
1. When an enumerated value is required and an unacceptable enumerated value is passed, this command returns the invalid_enum error, which also occurs when it points to the pointer parameter of the symbolic constant, if the constant value pointed to by the pointer is unacceptable for the command. If the defined enumerated constant only belongs to the common or common-lite part, if this constant is used in another part, the invali _ Enum error is returned.
2. When the parameter type is defined as sizei, if a negative number is passed, the invalid_value error is returned.
Table 2.3gl Error
3. When executing a GL command, the memory is exhausted and the command is affected, an out_of_memory error may occur.
Conditions for other errors are explicitly described in this document.