2191
|
1 |
/*
|
|
2 |
* OpenAL Bridge - a simple portable library for OpenAL interface
|
|
3 |
* Copyright (c) 2009 Vittorio Giovara <vittorio.giovara@gmail.com>
|
|
4 |
*
|
|
5 |
* This program is free software; you can redistribute it and/or modify
|
|
6 |
* it under the terms of the GNU General Public License as published by
|
|
7 |
* the Free Software Foundation; version 2 of the License
|
|
8 |
*
|
|
9 |
* This program is distributed in the hope that it will be useful,
|
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12 |
* GNU General Public License for more details.
|
|
13 |
*
|
|
14 |
* You should have received a copy of the GNU General Public License
|
|
15 |
* along with this program; if not, write to the Free Software
|
|
16 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
|
17 |
*/
|
|
18 |
|
|
19 |
#ifndef _SLEEP_H
|
|
20 |
#define _SLEEP_H
|
|
21 |
/** 1.0 02/03/10 - Defines cross-platform sleep, usleep, etc. * By Wu Yongwei **/
|
|
22 |
#ifdef _WIN32
|
|
23 |
# if defined(_NEED_SLEEP_ONLY) && (defined(_MSC_VER) || defined(__MINGW32__))
|
|
24 |
# include <stdlib.h>
|
|
25 |
# define sleep(t) _sleep((t) * 1000)
|
|
26 |
# else
|
|
27 |
# include <windows.h>
|
|
28 |
# define sleep(t) Sleep((t) * 1000)
|
|
29 |
# endif
|
|
30 |
# ifndef _NEED_SLEEP_ONLY
|
|
31 |
# define msleep(t) Sleep(t)
|
|
32 |
# define usleep(t) Sleep((t) / 1000)
|
|
33 |
# endif
|
|
34 |
#else
|
|
35 |
# include <unistd.h>
|
|
36 |
# ifndef _NEED_SLEEP_ONLY
|
|
37 |
# define msleep(t) usleep((t) * 1000)
|
|
38 |
# endif
|
|
39 |
#endif
|
|
40 |
|
|
41 |
#endif /* _SLEEP_H */
|
|
42 |
|
|
43 |
#ifdef __CPLUSPLUS
|
|
44 |
extern "C" {
|
|
45 |
#endif
|
|
46 |
|
|
47 |
#pragma once
|
|
48 |
|
|
49 |
ALint openal_init (int memorysize);
|
|
50 |
ALint openal_close (void);
|
|
51 |
int openal_loadfile (const char *filename);
|
|
52 |
ALint openal_toggleloop (int index);
|
|
53 |
ALint openal_setvolume (int index, unsigned char percentage);
|
|
54 |
ALint openal_setglobalvolume (unsigned char percentage);
|
|
55 |
ALint openal_togglemute (void);
|
|
56 |
ALint openal_fadeout (int index, unsigned int quantity);
|
|
57 |
ALint openal_fadein (int index, unsigned int quantity);
|
|
58 |
ALint openal_playsound (int index);
|
|
59 |
ALint openal_pausesound (int index);
|
|
60 |
ALint openal_stopsound (int index);
|
|
61 |
|
|
62 |
#ifdef __CPLUSPLUS
|
|
63 |
}
|
|
64 |
#endif |