1 #include "alutInternal.h"
4 static ALenum lastError = ALUT_ERROR_NO_ERROR;
7 _alutSetError (ALenum err)
9 /* print a message to stderr if ALUT_DEBUG environment variable is defined */
10 if (getenv ("ALUT_DEBUG"))
12 fprintf (stderr, "ALUT error: %s\n", alutGetErrorString (err));
15 if (lastError == ALUT_ERROR_NO_ERROR)
24 ALint ret = lastError;
25 lastError = ALUT_ERROR_NO_ERROR;
30 alutGetErrorString (ALenum error)
34 case ALUT_ERROR_NO_ERROR:
35 return "No ALUT error found";
37 case ALUT_ERROR_OUT_OF_MEMORY:
38 return "ALUT ran out of memory";
40 case ALUT_ERROR_INVALID_ENUM:
41 return "ALUT was given an invalid enumeration token";
43 case ALUT_ERROR_INVALID_VALUE:
44 return "ALUT was given an invalid value";
46 case ALUT_ERROR_INVALID_OPERATION:
47 return "The operation was invalid in the current ALUT state";
49 case ALUT_ERROR_NO_CURRENT_CONTEXT:
50 return "There is no current AL context";
52 case ALUT_ERROR_AL_ERROR_ON_ENTRY:
53 return "There was already an AL error on entry to an ALUT function";
55 case ALUT_ERROR_ALC_ERROR_ON_ENTRY:
56 return "There was already an ALC error on entry to an ALUT function";
58 case ALUT_ERROR_OPEN_DEVICE:
59 return "There was an error opening the ALC device";
61 case ALUT_ERROR_CLOSE_DEVICE:
62 return "There was an error closing the ALC device";
64 case ALUT_ERROR_CREATE_CONTEXT:
65 return "There was an error creating an ALC context";
67 case ALUT_ERROR_MAKE_CONTEXT_CURRENT:
68 return "Could not change the current ALC context";
70 case ALUT_ERROR_DESTROY_CONTEXT:
71 return "There was an error destroying the ALC context";
73 case ALUT_ERROR_GEN_BUFFERS:
74 return "There was an error generating an AL buffer";
76 case ALUT_ERROR_BUFFER_DATA:
77 return "There was an error passing buffer data to AL";
79 case ALUT_ERROR_IO_ERROR:
82 case ALUT_ERROR_UNSUPPORTED_FILE_TYPE:
83 return "Unsupported file type";
85 case ALUT_ERROR_UNSUPPORTED_FILE_SUBTYPE:
86 return "Unsupported mode within an otherwise usable file type";
88 case ALUT_ERROR_CORRUPT_OR_TRUNCATED_DATA:
89 return "The sound data was corrupt or truncated";
92 return "An impossible ALUT error condition was reported?!?";