Original Post
I'm trying to get into DirectSound. But everywhere I have looked, the tutorials are just for DirectMusic. The samples that come with the sdk are using a class called CSoundManager to wrap it all up (how is that supposed to help me learn anything?). I've tried to put it together myself by looking through various things, and I've come up with this to init dsound, is it even correct? I'm thinking now I need to make a DirectSoundBuffer for each wav I need to load? Does anyone know a good tutorial source that shows how to actually use direct sound directly? [grin]
//attempt to init direct sound
bool SoundInit(void)
{
if (DirectSoundCreate8(NULL,&lpDS,NULL) != S_OK)
{
MessageBox(GetHWND(),"SoundInit(): Failed to init sound device.",
APP_TITLE,MB_OK|MB_ICONERROR);
return false;
}
if (lpDS->SetCooperativeLevel(GetHWND(),DSSCL_EXCLUSIVE) != S_OK)
{
MessageBox(GetHWND(),"SoundInit(): Failed to set cooperation level.",
APP_TITLE,MB_OK|MB_ICONERROR);
return false;
}
return true;
}
void SoundShutdown(void)
{
lpDS->Release();
return;
}