author | koda |
Mon, 29 Jun 2009 20:01:05 +0000 | |
changeset 2211 | 288360b78f30 |
parent 2210 | 1cb7118a77dd |
child 2212 | 6b5da1a2765a |
permissions | -rw-r--r-- |
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 |
#include <stdio.h> |
|
20 |
#include <stdlib.h> |
|
21 |
#include "al.h" |
|
22 |
||
2210 | 23 |
#ifndef _WIN32 |
24 |
#include <pthread.h> |
|
25 |
#include <stdint.h> |
|
26 |
#else |
|
27 |
#define WIN32_LEAN_AND_MEAN |
|
2211
288360b78f30
- fade in/out functions merged, but kept binary compatibility
koda
parents:
2210
diff
changeset
|
28 |
#include <process.h> |
2210 | 29 |
#include "winstdint.h" |
30 |
#endif |
|
31 |
||
32 |
#ifndef _SLEEP_H |
|
33 |
#define _SLEEP_H |
|
34 |
/** 1.0 02/03/10 - Defines cross-platform sleep, usleep, etc. * By Wu Yongwei **/ |
|
35 |
#ifdef _WIN32 |
|
36 |
# if defined(_NEED_SLEEP_ONLY) && (defined(_MSC_VER) || defined(__MINGW32__)) |
|
37 |
# include <stdlib.h> |
|
38 |
# define sleep(t) _sleep((t) * 1000) |
|
39 |
# else |
|
40 |
# include <windows.h> |
|
41 |
# define sleep(t) Sleep((t) * 1000) |
|
42 |
# endif |
|
43 |
# ifndef _NEED_SLEEP_ONLY |
|
44 |
# define msleep(t) Sleep(t) |
|
45 |
# define usleep(t) Sleep((t) / 1000) |
|
46 |
# endif |
|
47 |
#else |
|
48 |
# include <unistd.h> |
|
49 |
# ifndef _NEED_SLEEP_ONLY |
|
50 |
# define msleep(t) usleep((t) * 1000) |
|
51 |
# endif |
|
52 |
#endif |
|
53 |
#endif /* _SLEEP_H */ |
|
54 |
||
55 |
#pragma once |
|
56 |
||
57 |
typedef struct _fade_t { |
|
58 |
int index; |
|
59 |
unsigned int quantity; |
|
60 |
} fade_t; |
|
61 |
||
2191 | 62 |
void *Malloc (size_t nbytes); |
63 |
FILE *Fopen (const char *fname, char *mode); |
|
64 |
ALint AlGetError (const char *str); |
|
2210 | 65 |
#ifndef _WIN32 |
66 |
void *helper_fadein (void *tmp); |
|
67 |
void *helper_fadeout (void *tmp); |
|
68 |
#else |
|
69 |
void WINAPI helper_fadein (void *tmp); |
|
70 |
void WINAPI helper_fadeout (void *tmp); |
|
71 |
#endif |