| OLD | NEW |
| 1 #include <stdlib.h> | 1 #include <stdlib.h> |
| 2 #include <stdio.h> | 2 #include <stdio.h> |
| 3 #include <AL/alut.h> | 3 #include <AL/alut.h> |
| 4 | 4 |
| 5 #include <ppapi_simple/ps_main.h> | |
| 6 #include <ppapi/c/ppb.h> | 5 #include <ppapi/c/ppb.h> |
| 7 | 6 |
| 8 /* | 7 /* |
| 9 This is the 'Hello World' program from the ALUT | 8 This is the 'Hello World' program from the ALUT |
| 10 reference manual. | 9 reference manual. |
| 11 | 10 |
| 12 Link using '-lalut -lopenal -lpthread'. | 11 Link using '-lalut -lopenal -lpthread'. |
| 13 */ | 12 */ |
| 14 | 13 |
| 15 void alSetPpapiInfo(PP_Instance instance, PPB_GetInterface get_interface); | 14 void alSetPpapiInfo(PP_Instance instance, PPB_GetInterface get_interface); |
| 16 | 15 |
| 17 int nacl_main(int argc, char** argv) { | 16 int main(int argc, char** argv) { |
| 18 ALuint helloBuffer, helloSource; | 17 ALuint helloBuffer, helloSource; |
| 19 | 18 |
| 20 /* | 19 /* |
| 21 * This extra line is required by the underlying openAl | 20 * This extra line is required by the underlying openAl |
| 22 * NaCl port. | 21 * NaCl port. |
| 23 */ | 22 */ |
| 24 alSetPpapiInfo(PSGetInstanceId(), PSGetInterface); | 23 alSetPpapiInfo(PSGetInstanceId(), PSGetInterface); |
| 25 | 24 |
| 26 alutInit(&argc, argv); | 25 alutInit(&argc, argv); |
| 27 helloBuffer = alutCreateBufferHelloWorld(); | 26 helloBuffer = alutCreateBufferHelloWorld(); |
| 28 alGenSources(1, &helloSource); | 27 alGenSources(1, &helloSource); |
| 29 alSourcei(helloSource, AL_BUFFER, helloBuffer); | 28 alSourcei(helloSource, AL_BUFFER, helloBuffer); |
| 30 alSourcePlay(helloSource); | 29 alSourcePlay(helloSource); |
| 31 alutSleep(1); | 30 alutSleep(1); |
| 32 alutExit(); | 31 alutExit(); |
| 33 return EXIT_SUCCESS; | 32 return EXIT_SUCCESS; |
| 34 } | 33 } |
| 35 | |
| 36 PPAPI_SIMPLE_REGISTER_MAIN(nacl_main) | |
| OLD | NEW |