summaryrefslogtreecommitdiff
path: root/engine/xe_sound.hpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--engine/xe_sound.hpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/engine/xe_sound.hpp b/engine/xe_sound.hpp
new file mode 100644
index 0000000..3d0caa2
--- /dev/null
+++ b/engine/xe_sound.hpp
@@ -0,0 +1,37 @@
+#pragma once
+
+#include <AL/al.h>
+#include <AL/alut.h>
+#include <string>
+
+#define GLM_FORCE_RADIANS
+#define GLM_FORCE_DEPTH_ZERO_TO_ONE
+#include <glm/glm.hpp>
+
+namespace xe {
+
+class XeSound {
+
+ public:
+
+ XeSound(const std::string& filename);
+ ~XeSound();
+
+ void play();
+ void stop();
+ void pause();
+ void resume();
+
+ bool isPlaying();
+
+ void setPosition(glm::vec3 position);
+ void setLooping(bool looping);
+
+ private:
+ ALuint source;
+ ALuint buffer;
+ ALenum format;
+
+};
+
+} \ No newline at end of file