jme3-ios/ios-data/templates/src/com_jme3_audio_android_AndroidOpenALSoftAudioRenderer.c
/* InitAL opens the default device and sets up a context using default
 * attributes, making the program ready to call OpenAL functions. */
InitAL opens the default device and sets up a context using default
attributes, making the program ready to call OpenAL functions.
InitAL opens the default device and sets up a context using default attributes making the program ready to call OpenAL functions .
int InitAL()
{
    ALCdevice *device;
    ALCcontext *ctx;
    device = alcOpenDevice(NULL);
    if(!device)
    {
        fprintf(stderr, "Could not open a device!\n");
        return 1;
    }
    ctx = alcCreateContext(device, NULL);
    fprintf(stderr, "NULL: %d", NULL);
    fprintf(stderr, "Created context: %d", ctx);
    fprintf(stderr, "Created context addr: %d", &ctx);
    if(ctx == NULL || alcMakeContextCurrent(ctx) == ALC_FALSE)
    {
        if(ctx != NULL)
            alcDestroyContext(ctx);
        alcCloseDevice(device);
        fprintf(stderr, "Could not set a context!\n");
        return 1;
    }
    printf("Opened \"%s\"\n", alcGetString(device, ALC_DEVICE_SPECIFIER));
    fprintf(stderr, "Opened %s", alcGetString(device, ALC_DEVICE_SPECIFIER));
    return 0;
}
int InitAL ( ) { ALCdevice * device ; ALCcontext * ctx ; device = alcOpenDevice ( NULL ) ; if ( ! device ) { fprintf ( stderr , " \n " ) ; return 1 ; } ctx = alcCreateContext ( device , NULL ) ; fprintf ( stderr , " " , NULL ) ; fprintf ( stderr , " " , ctx ) ; fprintf ( stderr , " " , & ctx ) ; if ( ctx == NULL || alcMakeContextCurrent ( ctx ) == ALC_FALSE ) { if ( ctx != NULL ) alcDestroyContext ( ctx ) ; alcCloseDevice ( device ) ; fprintf ( stderr , " \n " ) ; return 1 ; } printf ( " \" \" \n " , alcGetString ( device , ALC_DEVICE_SPECIFIER ) ) ; fprintf ( stderr , " " , alcGetString ( device , ALC_DEVICE_SPECIFIER ) ) ; return 0 ; }
InitAL opens the default device and sets up a context using default
 attributes, making the program ready to call OpenAL functions.
InitAL opens the default device and sets up a context using default attributes making the program ready to call OpenAL functions .
/* Open and initialize a device with default settings */