aboutsummaryrefslogtreecommitdiff
path: root/tests/freealut/examples/hello_world.c
diff options
context:
space:
mode:
authorEhsan Akhgari <ehsan.akhgari@gmail.com>2013-04-06 12:36:08 -0700
committerEhsan Akhgari <ehsan.akhgari@gmail.com>2013-04-06 12:36:08 -0700
commit350a2b08b6b19e57abc57e6ae607edae97a66fa8 (patch)
tree5de65f8e9c83101a2444449d755a71785bb76436 /tests/freealut/examples/hello_world.c
parent75c7e03bc5e282ee3969924c225a0e4545d5258b (diff)
parent6512c70b5487a9328e19a64f8118529eb4f77b55 (diff)
Merge pull request #1010 from azmeuk/openal
Minor OpenAL improvements.
Diffstat (limited to 'tests/freealut/examples/hello_world.c')
-rw-r--r--tests/freealut/examples/hello_world.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/freealut/examples/hello_world.c b/tests/freealut/examples/hello_world.c
new file mode 100644
index 00000000..ca5b4490
--- /dev/null
+++ b/tests/freealut/examples/hello_world.c
@@ -0,0 +1,23 @@
+#include <stdlib.h>
+#include <AL/alut.h>
+
+/*
+ This is the 'Hello World' program from the ALUT
+ reference manual.
+
+ Link using '-lalut -lopenal -lpthread'.
+*/
+
+int main(int argc, char **argv)
+{
+ ALuint helloBuffer, helloSource;
+
+ alutInit(&argc, argv);
+ helloBuffer = alutCreateBufferHelloWorld();
+ alGenSources(1, &helloSource);
+ alSourcei(helloSource, AL_BUFFER, helloBuffer);
+ alSourcePlay(helloSource);
+ alutSleep(1);
+ alutExit();
+ return EXIT_SUCCESS;
+}