Advertisement
Zgragselus

al device

Dec 13th, 2024
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.43 KB | None | 0 0
  1. ifndef __AUDIO_DEVICE__H__
  2. #define __AUDIO_DEVICE__H__
  3.  
  4. #include <AL/al.h>
  5. #include <AL/alc.h>
  6.  
  7. namespace Engine
  8. {
  9.     class AudioDevice
  10.     {
  11.     private:
  12.         ALCdevice* mDevice;
  13.  
  14.     public:
  15.         AudioDevice()
  16.         {
  17.             mDevice = alcOpenDevice(nullptr);
  18.         }
  19.  
  20.         ~AudioDevice()
  21.         {
  22.             if (mDevice != nullptr)
  23.             {
  24.                 alcCloseDevice(mDevice);
  25.             }
  26.         }
  27.  
  28.         inline ALCdevice* Get() const
  29.         {
  30.             return mDevice;
  31.         }
  32.     };
  33. }
  34.  
  35. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement