Soundsystem ALMOST DONE

This commit is contained in:
Adam
2014-03-10 01:58:29 +01:00
parent ba6cc660ca
commit 720d9d8776
3 changed files with 63 additions and 29 deletions
+9 -4
View File
@@ -5,11 +5,14 @@
#include "AL/alc.h"
#include "System.h"
#include "Components/Transform.h"
#include "Components/SoundEmitter.h"
#include <AL/al.h>
#include <AL/alc.h>
#include <windows.h>
#include <vector>
#include <glm/gtc/quaternion.hpp>
#include <glm/gtx/quaternion.hpp>
namespace Systems
{
@@ -24,20 +27,22 @@ public:
void OnComponentCreated(std::string type, std::shared_ptr<Component> component) override;
void PlaySound(std::shared_ptr<Components::SoundEmitter> emitter, std::string fileName);
void LoadFile(const char* fileName);
void CreateSource(int ID, float pos[3], ALboolean looping);
ALuint CreateSource();
private:
ALCcontext* context;
//File-info
char type[4];
DWORD size, chunkSize;
short formatType, channels;
DWORD sampleRate, avgBytesPerSec;
short bytesPerSample, bitsPerSample;
DWORD dataSize;
unsigned char* buf;
std::vector<ALuint> source;
std::map<Component*, ALuint> source;
std::map<std::string, ALuint> buffer; // string = fileName
};
}