SDL: More dsound adaptation (nw)

This commit is contained in:
R. Belmont 2014-09-12 02:33:25 +00:00
parent 0ebffa0620
commit 5191d3e9c7
4 changed files with 25 additions and 2 deletions

View File

@ -240,13 +240,15 @@ HRESULT sound_direct_sound::dsound_init()
// set the cooperative level
#ifndef SDLMAME_WIN32
result = IDirectSound_SetCooperativeLevel(dsound, (HWND *)sdl_window_list->windows_hwnd, DSSCL_PRIORITY);
#else
result = IDirectSound_SetCooperativeLevel(dsound, win_window_list->m_hwnd, DSSCL_PRIORITY);
#endif
if (result != DS_OK)
{
osd_printf_error("Error setting DirectSound cooperative level: %08x\n", (UINT32)result);
goto error;
}
#endif
// make a format description for what we want
stream_format.wBitsPerSample = 16;
@ -260,7 +262,7 @@ HRESULT sound_direct_sound::dsound_init()
// compute the buffer size based on the output sample rate
int audio_latency;
#ifdef SDLMAME_WIN32
audio_latency = downcast<sdl_options &>(machine.options()).audio_latency();
audio_latency = downcast<sdl_options &>(m_osd.machine().options()).audio_latency();
#else
audio_latency = downcast<windows_options &>(m_osd.machine().options()).audio_latency();
#endif

View File

@ -554,6 +554,13 @@ static int drawsdl2_window_create(sdl_window_info *window, int width, int height
window->sdl_window = SDL_CreateWindow(window->title, SDL_WINDOWPOS_UNDEFINED_DISPLAY(window->monitor->handle), SDL_WINDOWPOS_UNDEFINED,
width, height, sdl->extra_flags);
#if SDLMAME_WIN32
SDL_SysWMinfo wminfo;
SDL_VERSION(wminfo.version);
SDL_GetWindowWMInfo(window->sdl_window, &wminfo);
window->windows_hwnd = (void *)wminfo.win.info;
#endif
if (window->fullscreen && video_config.switchres)
{
SDL_DisplayMode mode;

View File

@ -519,6 +519,13 @@ static int drawogl_window_create(sdl_window_info *window, int width, int height)
return 1;
}
#if SDLMAME_WIN32
SDL_SysWMinfo wminfo;
SDL_VERSION(wminfo.version);
SDL_GetWindowWMInfo(window->sdl_window, &wminfo);
window->windows_hwnd = (void *)wminfo.win.info;
#endif
if (window->fullscreen && video_config.switchres)
{
SDL_DisplayMode mode;

View File

@ -409,6 +409,13 @@ static int drawsdl_window_create(sdl_window_info *window, int width, int height)
window->sdl_window = SDL_CreateWindow(window->title, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,
width, height, sdl->extra_flags);
#if SDLMAME_WIN32
SDL_SysWMinfo wminfo;
SDL_VERSION(wminfo.version);
SDL_GetWindowWMInfo(window->sdl_window, &wminfo);
window->windows_hwnd = (void *)wminfo.win.info;
#endif
if (window->fullscreen && video_config.switchres)
{
SDL_DisplayMode mode;