source: trunk/nv/sdl/sdl_audio.hh @ 543

Last change on this file since 543 was 543, checked in by epyon, 8 years ago
  • fixes in handle store
  • removal of get_handle
  • indices instead of handles
  • efficient handle store clears
File size: 1.3 KB
RevLine 
[395]1// Copyright (C) 2012-2015 ChaosForge Ltd
[194]2// http://chaosforge.org/
3//
[395]4// This file is part of Nova libraries.
5// For conditions of distribution and use, see copying.txt file in root folder.
6
[194]7/**
8 * @file sdl_audio.hh
9 * @author Kornel Kisielewicz epyon@chaosforge.org
10 * @brief SDL Audio interface
11 */
12
13#ifndef NV_SDL_AUDIO_HH
14#define NV_SDL_AUDIO_HH
15
[395]16#include <nv/common.hh>
[194]17#include <nv/interface/audio.hh>
[530]18#include <nv/stl/handle_store.hh>
[194]19
20namespace nv
21{
22
23        namespace sdl
24        {
[329]25                struct sound_info
[194]26                {
[329]27                        void* sdl_sound;
[194]28                };
29
30                class audio : public nv::audio
31                {
32                public:
33                        audio();
[330]34                        virtual channel play_sound( sound a_sound, float volume = 1.0f, float pan = 0.0f );
35                        virtual channel play_sound( sound a_sound, vec3 position );
[399]36                        virtual sound load_sound( const string_view& a_path );
[329]37                        virtual void release( sound a_sound );
[330]38                        virtual void set_orientation( vec3 forward, vec3 up );
39                        virtual void update( vec3 position );
[194]40                        virtual ~audio();
[329]41                private:
[543]42                        void release( sound_info* info );
43
[330]44                        vec3                                  m_position;
45                        vec3                                  m_forward;
46                        vec3                                  m_up;
[347]47                        handle_store< sound_info, sound >     m_sounds;
[194]48                };
49        }
50}
51
52#endif // NV_SDL_AUDIO_HH
Note: See TracBrowser for help on using the repository browser.