On 6 October 2014 13:42, Stefan Dösinger stefan@codeweavers.com wrote:
- device = create_device(d3d9, device_window, focus_window, FALSE);
- if (!device)
- present_parameters.Windowed = FALSE;
- present_parameters.hDeviceWindow = device_window;
- present_parameters.SwapEffect = D3DSWAPEFFECT_DISCARD;
- present_parameters.BackBufferWidth = 640;
- present_parameters.BackBufferHeight = 480;
- present_parameters.BackBufferFormat = D3DFMT_A8R8G8B8;
- if (FAILED(IDirect3D9_CreateDevice(d3d9, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, focus_window,
D3DCREATE_SOFTWARE_VERTEXPROCESSING, &present_parameters, &device)))
We're just hoping the display resolution isn't already 640x480 here, right? I'd also rather see this using create_device(). Or perhaps some variant like create_device_pp() taking a D3DPRESENT_PARAMETERS structure, although it seems to me that the issue you're running into is just that screen_width and screen_height aren't very good choices for the backbuffer dimensions in the general case.
Am 06.10.2014 um 15:49 schrieb Henri Verbeet hverbeet@gmail.com:
On 6 October 2014 13:42, Stefan Dösinger stefan@codeweavers.com wrote:
- device = create_device(d3d9, device_window, focus_window, FALSE);
- if (!device)
- present_parameters.Windowed = FALSE;
- present_parameters.hDeviceWindow = device_window;
- present_parameters.SwapEffect = D3DSWAPEFFECT_DISCARD;
- present_parameters.BackBufferWidth = 640;
- present_parameters.BackBufferHeight = 480;
- present_parameters.BackBufferFormat = D3DFMT_A8R8G8B8;
- if (FAILED(IDirect3D9_CreateDevice(d3d9, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, focus_window,
D3DCREATE_SOFTWARE_VERTEXPROCESSING, &present_parameters, &device)))
We're just hoping the display resolution isn't already 640x480 here, right?
Yes. It seems like a reasonable assumption to me nowadays. I preferred not to complicate the tests with checks for the current resolution.
I'd also rather see this using create_device(). Or perhaps some variant like create_device_pp() taking a D3DPRESENT_PARAMETERS structure,
I can do that, but you preferred a direct call to CreateDevice over a parameter when the parameter in question was software vs hardware rendering.
although it seems to me that the issue you're running into is just that screen_width and screen_height aren't very good choices for the backbuffer dimensions in the general case.
No, I think it is reasonable for the other tests that use fullscreen mode. On some monitors changing to a different mode takes a lot more time than just switching to fullscreen.