summaryrefslogtreecommitdiffstats
path: root/src/plugins/sound/oalsound/check.h
diff options
context:
space:
mode:
authorerihel <erihel@gmail.com>2012-07-04 19:38:18 +0200
committererihel <erihel@gmail.com>2012-07-04 19:38:18 +0200
commitecab9761d46754cd8d7a513a8ac16a8b88499d55 (patch)
treefeca28addca2bf6616c6e6b83a365879088f9986 /src/plugins/sound/oalsound/check.h
parent092e4ae75e28fca8cf13d0315eb3923ba1c27133 (diff)
downloadcolobot-ecab9761d46754cd8d7a513a8ac16a8b88499d55.tar.gz
colobot-ecab9761d46754cd8d7a513a8ac16a8b88499d55.tar.bz2
colobot-ecab9761d46754cd8d7a513a8ac16a8b88499d55.zip
* Added OpenAL sound plugin
Plugin needs some more work and tests. It doesn't support playing music yet as sound interface is propably going to change a bit.
Diffstat (limited to 'src/plugins/sound/oalsound/check.h')
-rw-r--r--src/plugins/sound/oalsound/check.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/plugins/sound/oalsound/check.h b/src/plugins/sound/oalsound/check.h
new file mode 100644
index 0000000..cb6b4a1
--- /dev/null
+++ b/src/plugins/sound/oalsound/check.h
@@ -0,0 +1,39 @@
+// * This file is part of the COLOBOT source code
+// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
+// *
+// * This program is free software: you can redistribute it and/or modify
+// * it under the terms of the GNU General Public License as published by
+// * the Free Software Foundation, either version 3 of the License, or
+// * (at your option) any later version.
+// *
+// * This program is distributed in the hope that it will be useful,
+// * but WITHOUT ANY WARRANTY; without even the implied warranty of
+// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// * GNU General Public License for more details.
+// *
+// * You should have received a copy of the GNU General Public License
+// * along with this program. If not, see http://www.gnu.org/licenses/.
+
+// check.h
+
+#pragma once
+
+#include <AL/al.h>
+#include <AL/alc.h>
+
+#include <common/logger.h>
+
+static ALenum CODE = AL_NO_ERROR;
+
+inline bool alCheck()
+{
+ CODE = alGetError();
+ return CODE != AL_NO_ERROR;
+}
+
+inline ALenum alGetCode()
+{
+ ALenum ret = CODE;
+ CODE = AL_NO_ERROR;
+ return ret;
+}