global focus dsound in win32. give it the desktop window so we don't have to care about window handles.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4306 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
c0167628f2
commit
b90b032238
1 changed files with 5 additions and 1 deletions
|
@ -689,7 +689,9 @@ static int DSOUND_InitCard_Internal (soundcardinfo_t *sc, int cardnum)
|
|||
return SND_ERROR;
|
||||
}
|
||||
|
||||
SendMessage(mainwindow, WM_USER, 0, 0);
|
||||
#ifdef _SDL
|
||||
#define mainwindow GetDesktopWindow()
|
||||
#endif
|
||||
if (DS_OK != dh->pDS->lpVtbl->SetCooperativeLevel (dh->pDS, mainwindow, DSSCL_EXCLUSIVE))
|
||||
{
|
||||
Con_SafePrintf ("Set coop level failed\n");
|
||||
|
@ -707,8 +709,10 @@ static int DSOUND_InitCard_Internal (soundcardinfo_t *sc, int cardnum)
|
|||
dsbuf.lpwfxFormat = NULL;
|
||||
|
||||
#ifdef DSBCAPS_GLOBALFOCUS
|
||||
#ifndef _SDL
|
||||
if (snd_inactive.ival || sys_parentwindow
|
||||
) /*always inactive if we have a parent window, because we can't tell properly otherwise*/
|
||||
#endif
|
||||
{
|
||||
dsbuf.dwFlags |= DSBCAPS_GLOBALFOCUS;
|
||||
sc->inactive_sound = true;
|
||||
|
|
Loading…
Reference in a new issue