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