| 1172 | |
| 1173 | |
| 1174 | ILint iGetInt(ILenum Mode) |
| 1175 | { |
| 1176 | //like ilGetInteger(), but sets another error on failure |
| 1177 | |
| 1178 | //call ilGetIntegerv() for more robust code |
| 1179 | ILenum err; |
| 1180 | ILint r = -1; |
| 1181 | |
| 1182 | ilGetIntegerv(Mode, &r); |
| 1183 | |
| 1184 | //check if an error occured, set another error |
| 1185 | err = ilGetError(); |
| 1186 | if (r == -1 && err == IL_INVALID_ENUM) |
| 1187 | ilSetError(IL_INTERNAL_ERROR); |
| 1188 | else |
| 1189 | ilSetError(err); //restore error |
| 1190 | |
| 1191 | return r; |
| 1192 | } |
no test coverage detected