
/*********************************************************************
 ** Copyright (c) 1992-2022 MAK Technologies, Inc.
 ** All rights reserved. 
 *********************************************************************/

/*********************************************************************
 **
 *t  DI-Guy API, OpenAL Sound Module
 **
 *b    Link against: libdiguy_module_sound_openal
 **
 **
 *============================================================================
 **
 *b  Regarding Ogg Vorbis software used in this library:
 **
 **   Copyright (c) 2002, Xiph.org Foundation
 **
 **   Redistribution and use in source and binary forms, with or without
 **   modification, are permitted provided that the following conditions
 **   are met:
 **
 **   - Redistributions of source code must retain the above copyright
 **   notice, this list of conditions and the following disclaimer.
 **
 **   - Redistributions in binary form must reproduce the above copyright
 **   notice, this list of conditions and the following disclaimer in the
 **   documentation and/or other materials provided with the distribution.
 **
 **   - Neither the name of the Xiph.org Foundation nor the names of its
 **   contributors may be used to endorse or promote products derived from
 **   this software without specific prior written permission.
 **
 **   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 **   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 **   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 **   A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR
 **   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 **   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 **   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 **   PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
 **   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 **   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 **   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 **
 *============================================================================
 **
 */

#ifndef __diguy_module_sound_openal_H
#define __diguy_module_sound_openal_H

#include <declspec_diguy.h>

extern "C" {

/*
 *  The definition of this struct is in bdiSoundInitOpenAL.h
 */
struct bdiSoundInitOpenAL;

/*****************************************************************************
 **
 *2  Functions
 **
 */

/*l
 *b  Description:
 **
 **    This function tells DI-Guy that it should use the OpenAL API for
 **    playing back sounds.
 **
 **    This function must be called before a scenario is created.
 **
 **    This function must be called after the main DI-Guy initialize call
 **    (e.g., diguy_ogl_initialize()).
 **
 *b  Returns:
 **
 **    0 on success, -1 on failure
 **
 *b  Example:
 **
 *e    bdiSoundInitOpenAL init;
 *e    
 *e    diguy_ogl_initialize(NULL);
 *e    diguy_script_lua_initialize();
 *e    diguy_sound_openal_get_defaults(&init);
 *e    diguy_sound_openal_initialize(&init);
 *e    
 *e    diguyScenario* scenario = diguy_create_scenario();
 */
BDI_DECLSPEC_diguy
int diguy_sound_openal_initialize(bdiSoundInitOpenAL* init);

/*l
 *b  Description:
 **
 **    Fills out the init structure with default values.  Selected entries can
 **    then be changed before calling diguy_sound_openal_initialize().
 **
 *b  Arguments:
 **
 *a    init - pointer to type bdiSoundInitOpenAL
 **
 *b  Returns:
 **
 **    0 on success, -1 on failure
 */
BDI_DECLSPEC_diguy
int diguy_sound_openal_get_defaults(bdiSoundInitOpenAL* init);

/*l
 *b  Description:
 **
 **    This function tells DI-Guy to shut down the OpenAL DirectSound API for
 **    playing back sounds.
 **
 *b  Returns:
 **
 **    0 on success, -1 on failure
 **
 */
BDI_DECLSPEC_diguy
int diguy_sound_openal_deinitialize();


} /* end extern "C" */


#endif /* __diguy_module_sound_openal_H */

