mirror of https://github.com/nzp-team/fteqw.git
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
|
@ -689,7 +689,9 @@ static int DSOUND_InitCard_Internal (soundcardinfo_t *sc, int cardnum)
|
||||||
return SND_ERROR;
|
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))
|
if (DS_OK != dh->pDS->lpVtbl->SetCooperativeLevel (dh->pDS, mainwindow, DSSCL_EXCLUSIVE))
|
||||||
{
|
{
|
||||||
Con_SafePrintf ("Set coop level failed\n");
|
Con_SafePrintf ("Set coop level failed\n");
|
||||||
|
@ -707,8 +709,10 @@ static int DSOUND_InitCard_Internal (soundcardinfo_t *sc, int cardnum)
|
||||||
dsbuf.lpwfxFormat = NULL;
|
dsbuf.lpwfxFormat = NULL;
|
||||||
|
|
||||||
#ifdef DSBCAPS_GLOBALFOCUS
|
#ifdef DSBCAPS_GLOBALFOCUS
|
||||||
|
#ifndef _SDL
|
||||||
if (snd_inactive.ival || sys_parentwindow
|
if (snd_inactive.ival || sys_parentwindow
|
||||||
) /*always inactive if we have a parent window, because we can't tell properly otherwise*/
|
) /*always inactive if we have a parent window, because we can't tell properly otherwise*/
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
dsbuf.dwFlags |= DSBCAPS_GLOBALFOCUS;
|
dsbuf.dwFlags |= DSBCAPS_GLOBALFOCUS;
|
||||||
sc->inactive_sound = true;
|
sc->inactive_sound = true;
|
||||||
|
|
Loading…
Reference in New Issue