SDL: more attempts (nw)

This commit is contained in:
R. Belmont 2014-09-12 02:44:11 +00:00
parent 5191d3e9c7
commit 1527f5ca82
4 changed files with 10 additions and 23 deletions

View File

@ -26,6 +26,11 @@
#ifdef SDLMAME_WIN32
#include "../../sdl/osdsdl.h"
#if (SDLMAME_SDL2)
#include <SDL2/SDL_syswm.h>
#else
#include <SDL/SDL_syswm.h>
#endif
#else
#include "winmain.h"
#include "window.h"
@ -239,8 +244,11 @@ 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);
#ifdef SDLMAME_WIN32
SDL_SysWMinfo wminfo;
SDL_VERSION(&wminfo.version);
SDL_GetWindowWMInfo(sdl_window_list->sdl_window, &wminfo);
result = IDirectSound_SetCooperativeLevel(dsound, wminfo.win.window, DSSCL_PRIORITY);
#else
result = IDirectSound_SetCooperativeLevel(dsound, win_window_list->m_hwnd, DSSCL_PRIORITY);
#endif

View File

@ -554,13 +554,6 @@ 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,13 +519,6 @@ 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,13 +409,6 @@ 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;