| 24 | |
| 25 | |
| 26 | void* alcGetProcAddress(ALCdevice *device, const ALCchar *name) { |
| 27 | // Validate the input. |
| 28 | if (EM_ASM_INT({ |
| 29 | if (!$0) { |
| 30 | AL.alcErr = 0xA004 /* ALC_INVALID_VALUE */; |
| 31 | return 1; |
| 32 | } |
| 33 | }, name)) { |
| 34 | return NULL; |
| 35 | } |
| 36 | |
| 37 | // Base API |
| 38 | if (!strcmp(name, "alcCreateContext")) { return alcCreateContext; } |
| 39 | else if (!strcmp(name, "alcMakeContextCurrent")) { return alcMakeContextCurrent; } |
| 40 | else if (!strcmp(name, "alcProcessContext")) { return alcProcessContext; } |
| 41 | else if (!strcmp(name, "alcSuspendContext")) { return alcSuspendContext; } |
| 42 | else if (!strcmp(name, "alcDestroyContext")) { return alcDestroyContext; } |
| 43 | else if (!strcmp(name, "alcGetCurrentContext")) { return alcGetCurrentContext; } |
| 44 | else if (!strcmp(name, "alcGetContextsDevice")) { return alcGetContextsDevice; } |
| 45 | else if (!strcmp(name, "alcOpenDevice")) { return alcOpenDevice; } |
| 46 | else if (!strcmp(name, "alcCloseDevice")) { return alcCloseDevice; } |
| 47 | else if (!strcmp(name, "alcGetError")) { return alcGetError; } |
| 48 | else if (!strcmp(name, "alcIsExtensionPresent")) { return alcIsExtensionPresent; } |
| 49 | else if (!strcmp(name, "alcGetProcAddress")) { return alcGetProcAddress; } |
| 50 | else if (!strcmp(name, "alcGetEnumValue")) { return alcGetEnumValue; } |
| 51 | else if (!strcmp(name, "alcGetString")) { return alcGetString; } |
| 52 | else if (!strcmp(name, "alcGetIntegerv")) { return alcGetIntegerv; } |
| 53 | else if (!strcmp(name, "alcCaptureOpenDevice")) { return alcCaptureOpenDevice; } |
| 54 | else if (!strcmp(name, "alcCaptureCloseDevice")) { return alcCaptureCloseDevice; } |
| 55 | else if (!strcmp(name, "alcCaptureStart")) { return alcCaptureStart; } |
| 56 | else if (!strcmp(name, "alcCaptureStop")) { return alcCaptureStop; } |
| 57 | else if (!strcmp(name, "alcCaptureSamples")) { return alcCaptureSamples; } |
| 58 | |
| 59 | // Extensions |
| 60 | else if (!strcmp(name, "alcDevicePauseSOFT")) { return emscripten_alcDevicePauseSOFT; } |
| 61 | else if (!strcmp(name, "alcDeviceResumeSOFT")) { return emscripten_alcDeviceResumeSOFT; } |
| 62 | else if (!strcmp(name, "alcGetStringiSOFT")) { return emscripten_alcGetStringiSOFT; } |
| 63 | else if (!strcmp(name, "alcResetDeviceSOFT")) { return emscripten_alcResetDeviceSOFT; } |
| 64 | |
| 65 | emscripten_errf("bad name in alcGetProcAddress: %s", name); |
| 66 | return 0; |
| 67 | } |
| 68 | |
| 69 | |
| 70 | void* alGetProcAddress(const ALchar *name) { |