summaryrefslogtreecommitdiff
path: root/engine/xe_sound.hpp
blob: 4a5083937a1ee055023b7cf2202997a0acabba24 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#pragma once

#include <AL/al.h>
#include <AL/alc.h>
#include <AL/alut.h>
#include <string>
#include <vector>
#include <stdexcept>
#include <iostream>

#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);
		void setVolume(float volume);

	private:
		ALuint source;
		ALuint buffer;
		ALenum format;

};

}