Open Source Tomb Raider Engine
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

SoundAL.h 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*!
  2. * \file include/system/SoundAL.h
  3. * \brief This is the OpenAL audio manager Header
  4. *
  5. * \author xythobuz
  6. */
  7. #ifndef _SOUND_AL_H_
  8. #define _SOUND_AL_H_
  9. #include <vector>
  10. class SoundAL {
  11. public:
  12. static int initialize();
  13. static void shutdown();
  14. static void clear();
  15. static int numBuffers();
  16. static int loadBuffer(unsigned char* buffer, unsigned int length);
  17. static int numSources(bool atListener);
  18. static int addSource(int buffer, float volume, bool atListener, bool loop);
  19. static int sourceAt(int source, glm::vec3 pos);
  20. static void listenAt(glm::vec3 pos, glm::vec3 at, glm::vec3 up);
  21. static void play(int source, bool atListener);
  22. static void stopAll();
  23. static void setEnabled(bool on);
  24. static bool getEnabled();
  25. static void setVolume(float vol);
  26. static float getVolume();
  27. private:
  28. static bool init;
  29. static bool enabled;
  30. static float volume;
  31. static std::vector<unsigned int> buffers;
  32. static std::vector<unsigned int> sources;
  33. static std::vector<unsigned int> listenerSources;
  34. static glm::vec3 lastPosition;
  35. };
  36. #endif