Guest User

sound_render.h

a guest
May 24th, 2016
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.82 KB | None | 0 0
  1. #ifndef SoundRender_CoreAH
  2. #define SoundRender_CoreAH
  3. #pragma once
  4.  
  5. #include "SoundRender_Core.h"            
  6. #include "OpenALDeviceList.h"
  7. #include <eax/eax.h>
  8.  
  9.  
  10. #ifdef DEBUG
  11. #   define A_CHK(expr)      { alGetError();         expr; ALenum error=alGetError();            VERIFY2(error==AL_NO_ERROR, (LPCSTR)alGetString(error)); }
  12. #   define AC_CHK(expr)     { alcGetError(pDevice); expr; ALCenum error=alcGetError(pDevice);   VERIFY2(error==ALC_NO_ERROR,(LPCSTR)alcGetString(pDevice,error)); }
  13. #else
  14. #   define A_CHK(expr)      { expr; }
  15. #   define AC_CHK(expr)     { expr; }
  16. #endif
  17.  
  18. class CSoundRender_CoreA: public CSoundRender_Core
  19. {
  20.     typedef CSoundRender_Core inherited;
  21.     EAXSet                  eaxSet;                 // EAXSet function, retrieved if EAX Extension is supported
  22.     EAXGet                  eaxGet;                 // EAXGet function, retrieved if EAX Extension is supported
  23.     ALCdevice*              pDevice;
  24.     ALCcontext*             pContext;
  25.     ALDeviceList*           pDeviceList;
  26.  
  27.     struct SListener{
  28.         Fvector             position;
  29.         Fvector             orientation[2];
  30. float doppler;
  31. float speed;    
  32.     };
  33.     SListener               Listener;
  34.  
  35.     BOOL                    EAXQuerySupport         (BOOL bDeferred, const GUID* guid, u32 prop, void* val, u32 sz);
  36.     BOOL                    EAXTestSupport          (BOOL bDeferred);
  37. protected:
  38.     virtual void            i_eax_set               (const GUID* guid, u32 prop, void* val, u32 sz);
  39.     virtual void            i_eax_get               (const GUID* guid, u32 prop, void* val, u32 sz);
  40.     virtual void            update_listener         ( const Fvector& P, const Fvector& D, const Fvector& N, float dt );
  41. public:
  42.                             CSoundRender_CoreA      ();
  43.     virtual                 ~CSoundRender_CoreA     ();
  44.  
  45.     virtual void            _initialize             (int stage);
  46.     virtual void            _clear                  ( );
  47.     virtual void            _restart                ( );
  48.    
  49.     virtual void            set_master_volume       ( float f       );
  50.  
  51.     virtual const Fvector&  listener_position       ( ){return Listener.position;}
  52. };
  53. extern CSoundRender_CoreA* SoundRenderA;
  54. #endif
Advertisement
Add Comment
Please, Sign In to add comment