aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-05-23 12:14:51 -0700
committerChris Robinson <[email protected]>2014-05-23 12:14:51 -0700
commit13eac2552e8df0e0a4d5e2012497d4076a365661 (patch)
tree82e051ed09211a2718ec692c08d8e19330a9fb54 /examples
parent5ef5d218c40f36c20f1971d2fc6af101ed00d756 (diff)
Update the examples to use SDL2
This should make it easier to build the examples on 64-bit, where there are no premade dev libs for SDL1 on 64-bit mingw. FindSDL_sound.cmake has been updated to accept SDL or SDL2.
Diffstat (limited to 'examples')
-rw-r--r--examples/alloopback.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/examples/alloopback.c b/examples/alloopback.c
index 649ef6ef..2361ada1 100644
--- a/examples/alloopback.c
+++ b/examples/alloopback.c
@@ -92,13 +92,15 @@ static ALuint CreateSineWave(void)
}
-int main()
+int main(int argc, char *argv[])
{
PlaybackInfo playback = { NULL, NULL, 0 };
SDL_AudioSpec desired, obtained;
ALuint source, buffer;
ALCint attrs[16];
ALenum state;
+ (void)argc;
+ (void)argv;
/* Print out error if extension is missing. */
if(!alcIsExtensionPresent(NULL, "ALC_SOFT_loopback"))
@@ -167,6 +169,8 @@ int main()
attrs[6] = 0; /* end of list */
+ playback.FrameSize = FramesToBytes(1, attrs[1], attrs[3]);
+
/* Initialize OpenAL loopback device, using our format attributes. */
playback.Device = alcLoopbackOpenDeviceSOFT(NULL);
if(!playback.Device)
@@ -187,7 +191,6 @@ int main()
fprintf(stderr, "Failed to set an OpenAL audio context\n");
goto error;
}
- playback.FrameSize = FramesToBytes(1, attrs[1], attrs[3]);
/* Start SDL playing. Our callback (thus alcRenderSamplesSOFT) will now
* start being called regularly to update the AL playback state. */