wined3d: Pass the proper DeviceName to ChangeDisplaySettings.
This commit is contained in:
parent
1c8a466cca
commit
6b177c44e1
|
@ -1343,8 +1343,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateAdditionalSwapChain(IWineD3DDevic
|
|||
devmode.dmBitsPerPel = (bpp >= 24) ? 32 : bpp; /* Stupid XVidMode cannot change bpp */
|
||||
devmode.dmPelsWidth = pPresentationParameters->BackBufferWidth;
|
||||
devmode.dmPelsHeight = pPresentationParameters->BackBufferHeight;
|
||||
MultiByteToWideChar(CP_ACP, 0, "Gamers CG", -1, devmode.dmDeviceName, CCHDEVICENAME);
|
||||
ChangeDisplaySettingsExW(devmode.dmDeviceName, &devmode, object->win_handle, CDS_FULLSCREEN, NULL);
|
||||
ChangeDisplaySettingsExW(This->adapter->DeviceName, &devmode, NULL, CDS_FULLSCREEN, NULL);
|
||||
|
||||
/* For GetDisplayMode */
|
||||
This->ddraw_width = devmode.dmPelsWidth;
|
||||
|
|
|
@ -2479,6 +2479,8 @@ BOOL InitAdapters(void) {
|
|||
/* For now only one default adapter */
|
||||
{
|
||||
int attribute;
|
||||
DISPLAY_DEVICEW DisplayDevice;
|
||||
|
||||
TRACE("Initializing default adapter\n");
|
||||
Adapters[0].monitorPoint.x = -1;
|
||||
Adapters[0].monitorPoint.y = -1;
|
||||
|
@ -2499,6 +2501,12 @@ BOOL InitAdapters(void) {
|
|||
Adapters[0].driver = "Display";
|
||||
Adapters[0].description = "Direct3D HAL";
|
||||
|
||||
/* Initialize the Adapter's DeviceName which is required for ChangeDisplaySettings and friends */
|
||||
DisplayDevice.cb = sizeof(DisplayDevice);
|
||||
EnumDisplayDevicesW(NULL, 0 /* Adapter 0 = iDevNum 0 */, &DisplayDevice, 0);
|
||||
TRACE("DeviceName: %s\n", debugstr_w(DisplayDevice.DeviceName));
|
||||
strcpyW(Adapters[0].DeviceName, DisplayDevice.DeviceName);
|
||||
|
||||
if (WineD3D_CreateFakeGLContext()) {
|
||||
int iPixelFormat;
|
||||
int attribs[8];
|
||||
|
|
|
@ -588,6 +588,7 @@ struct WineD3DAdapter
|
|||
WineD3D_GL_Info gl_info;
|
||||
const char *driver;
|
||||
const char *description;
|
||||
WCHAR DeviceName[CCHDEVICENAME]; /* DeviceName for use with e.g. ChangeDisplaySettings */
|
||||
int nCfgs;
|
||||
WineD3D_PixelFormat *cfgs;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue