source: golgotha/src/i4/sound/dsound/d3dsound.hh @ 80

Last change on this file since 80 was 80, checked in by Sam Hocevar, 14 years ago
  • Adding the Golgotha source code. Not sure what's going to be interesting in there, but since it's all public domain, there's certainly stuff to pick up.
File size: 1.7 KB
Line 
1/********************************************************************** <BR>
2  This file is part of Crack dot Com's free source code release of
3  Golgotha. <a href="http://www.crack.com/golgotha_release"> <BR> for
4  information about compiling & licensing issues visit this URL</a>
5  <PRE> If that doesn't help, contact Jonathan Clark at
6  golgotha_source@usa.net (Subject should have "GOLG" in it)
7***********************************************************************/
8
9#ifndef D3DSOUND_HH
10#define D3DSOUND_HH
11
12#include <dsound.h>
13#include "sound/sound3d.hh"
14
15class d3dsound_buffer_class : public i4_3d_voice_class
16{
17public:
18  w32 flags;
19  w8 *data;
20  DS3DBUFFER ds_param;
21  IDirectSoundBuffer *pDSB;
22  IDirectSound3DBuffer *pDS3DB;
23  completion_function_type completer;
24  void *context;
25
26  d3dsound_buffer_class() : pDSB(0), pDS3DB(0), data(0) {}
27
28  ~d3dsound_buffer_class()
29  //{{{
30  {
31    if (pDS3DB)
32      pDS3DB->Release();
33    if (pDSB)
34      pDSB->Release();
35  }
36  //}}}
37
38  virtual void set_completer(completion_function_type _completer, void *_context);
39  virtual void play();
40  virtual void update();
41};
42
43class direct_3dsound_class : public i4_3d_sound_manager_class
44{
45protected:
46  LPDIRECTSOUND lpDirectSound;
47  IDirectSoundBuffer *lpPrimary;
48  d3dsound_buffer_class *sound;
49
50  void load(w32 max_sounds);
51public:
52  I4_SOUND_NAME("DirectSound");
53 
54  virtual void load_sounds(w32 max_sounds);
55
56  virtual i4_3d_voice_class *alloc(i4_sound_id sound_id, const i4_3d_sound_parameters& param);
57};
58extern direct_3dsound_class direct_3dsound;
59
60#endif
61
62//{{{ Emacs Locals
63// Local Variables:
64// folded-file: t
65// End:
66//}}}
Note: See TracBrowser for help on using the repository browser.