Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(781)

Side by Side Diff: ports/alut-demo/alut_hello_world.c

Issue 1417223003: Switch from using 'nacl_main' to 'main' entry point (Closed) Base URL: https://chromium.googlesource.com/external/naclports.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ports/alut-demo/Makefile ('k') | ports/alut-demo/build.sh » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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)
OLDNEW
« no previous file with comments | « ports/alut-demo/Makefile ('k') | ports/alut-demo/build.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698