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

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
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>
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)
OLDNEW
« no previous file with comments | « ports/agg-demo/drawing.cc ('k') | ports/avrdude/build.sh » ('j') | ports/avrdude/nacl.patch » ('J')

Powered by Google App Engine
This is Rietveld 408576698