Commit 008e9d42 authored by Sam Lantinga's avatar Sam Lantinga

Use the sticky focus flag so audio isn't muted when application is switched.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40218
parent 12fbaa83
...@@ -441,6 +441,7 @@ static int CreatePrimary(LPDIRECTSOUND sndObj, HWND focus, ...@@ -441,6 +441,7 @@ static int CreatePrimary(LPDIRECTSOUND sndObj, HWND focus,
memset(&format, 0, sizeof(format)); memset(&format, 0, sizeof(format));
format.dwSize = sizeof(format); format.dwSize = sizeof(format);
format.dwFlags=(DSBCAPS_PRIMARYBUFFER|DSBCAPS_GETCURRENTPOSITION2); format.dwFlags=(DSBCAPS_PRIMARYBUFFER|DSBCAPS_GETCURRENTPOSITION2);
format.dwFlags |= DSBCAPS_STICKYFOCUS;
#ifdef USE_POSITION_NOTIFY #ifdef USE_POSITION_NOTIFY
format.dwFlags |= DSBCAPS_CTRLPOSITIONNOTIFY; format.dwFlags |= DSBCAPS_CTRLPOSITIONNOTIFY;
#endif #endif
...@@ -525,6 +526,8 @@ static int CreateSecondary(LPDIRECTSOUND sndObj, HWND focus, ...@@ -525,6 +526,8 @@ static int CreateSecondary(LPDIRECTSOUND sndObj, HWND focus,
#endif #endif
if ( ! focus ) { if ( ! focus ) {
format.dwFlags |= DSBCAPS_GLOBALFOCUS; format.dwFlags |= DSBCAPS_GLOBALFOCUS;
} else {
format.dwFlags |= DSBCAPS_STICKYFOCUS;
} }
format.dwBufferBytes = numchunks*chunksize; format.dwBufferBytes = numchunks*chunksize;
if ( (format.dwBufferBytes < DSBSIZE_MIN) || if ( (format.dwBufferBytes < DSBSIZE_MIN) ||
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment