Set the motion transform id in the collection step.
[flightgear.git] / tests / al-info.c
blob9969fcf3b5f1c027de4f0c93a6dfc7985bd41ede
2 #include <stdio.h>
4 #ifdef __APPLE__
5 # include <OpenAL/al.h>
6 # include <OpenAL/alc.h>
7 #else
8 # include <AL/al.h>
9 # include <AL/alc.h>
10 # ifndef __CYGWIN__
11 # include <AL/alext.h>
12 # endif
13 #endif
15 #ifndef AL_VERSION_1_1
16 # ifdef __APPLE__
17 # include <OpenAL/altypes.h>
18 # include <OpenAL/alctypes.h>
19 #else
20 # include <AL/altypes.h>
21 # include <AL/alctypes.h>
22 # endif
23 #endif
25 #define MAX_DATA 16
27 int main()
29 ALCint i,j;
30 ALCint data[MAX_DATA];
31 ALCdevice *device = NULL;
32 ALCcontext *context = NULL;
33 const unsigned char *s;
34 ALCenum error;
36 device = alcOpenDevice(NULL);
37 if (device == NULL)
39 printf("No default audio device available.\n");
40 return -1;
42 context = alcCreateContext(device, NULL);
43 if (context == NULL)
45 printf("Could not create a valid context.\n");
46 return -2;
48 alcMakeContextCurrent(context);
50 s = alGetString(AL_VENDOR);
51 printf("AL_VENDOR = \"%s\"\n", s);
53 s = alGetString(AL_RENDERER);
54 printf("AL_RENDERER = \"%s\"\n", s);
56 s = alGetString(AL_VERSION);
57 printf("AL_VERSION = \"%s\"\n", s);
59 s = alGetString(AL_EXTENSIONS);
60 printf("AL_EXTENSIONS = \"%s\"\n", s);
62 alcGetError(device);
64 printf("\n");
65 if (alcIsExtensionPresent(NULL, (unsigned char *)"ALC_ENUMERATION_EXT") == AL_TRUE)
67 s = alcGetString(NULL, ALC_DEVICE_SPECIFIER);
68 printf("ALC_DEVICE_SPECIFIER = \"%s\"\n", s);
71 alcGetIntegerv(device, ALC_MAJOR_VERSION, 1, data);
72 printf("ALC_MAJOR_VERSION = %i\n", *data);
73 alcGetIntegerv(device, ALC_MINOR_VERSION, 1, data);
74 printf("ALC_MINOR_VERSION = %i\n", *data);
76 s = alcGetString(device, ALC_EXTENSIONS);
77 printf("ALC_EXTENSIONS = \"%s\"\n", s);
79 if ((error = alcGetError(device)))
81 printf("Error #%i occured\n", error);
82 return error;
85 s = alcGetString(device, ALC_DEFAULT_DEVICE_SPECIFIER);
86 printf("ALC_DEFAULT_DEVICE_SPECIFIER = \"%s\"\n", s);
88 if ((error = alcGetError(device)))
90 printf("Error #%i occured\n", error);
91 return error;
94 #if 0
95 alcGetIntegerv(device, ALC_ATTRIBUTES_SIZE, 1, &i);
96 printf("ALC attributes(%i): ", i);
98 alcGetIntegerv(device, ALC_ALL_ATTRIBUTES, i, data);
99 for (j=0; j<i; j++)
101 printf("%i ", data[j]);
103 printf("\n");
105 if ((error = alcGetError(device)))
107 printf("Error #%i occured\n", error);
108 return error;
110 #endif
112 alcCloseDevice(device);
114 return 0;