diff options
Diffstat (limited to 'tests/freealut/examples/hello_world.c')
-rw-r--r-- | tests/freealut/examples/hello_world.c | 23 |
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; +} |