dwBehaviorFlags = D3DCREATE_HARDWARE_VERTEXPROCESSING;
}
+ D3DDISPLAYMODE Mode;
+ hr = g_pD3D->GetAdapterDisplayMode(D3DADAPTER_DEFAULT, &Mode);
+ if (FAILED(hr)) {
+ return 1;
+ }
+
ZeroMemory(&g_PresentationParameters, sizeof g_PresentationParameters);
g_PresentationParameters.Windowed = Windowed;
- if (!Windowed) {
+ if (Windowed) {
g_PresentationParameters.BackBufferWidth = WindowWidth;
g_PresentationParameters.BackBufferHeight = WindowHeight;
+ } else {
+ g_PresentationParameters.BackBufferWidth = Mode.Width;
+ g_PresentationParameters.BackBufferHeight = Mode.Height;
}
+ g_PresentationParameters.BackBufferFormat = Mode.Format;
g_PresentationParameters.BackBufferCount = 1;
g_PresentationParameters.SwapEffect = D3DSWAPEFFECT_DISCARD;
- if (Windowed) {
- // Must matche the format of the current display mode
- D3DDISPLAYMODE Mode;
- hr = g_pD3D->GetAdapterDisplayMode(D3DADAPTER_DEFAULT, &Mode);
- if (FAILED(hr)) {
- g_pD3D->Release();
- g_pD3D = NULL;
- return 1;
- }
- g_PresentationParameters.BackBufferFormat = Mode.Format;
- } else {
- g_PresentationParameters.BackBufferFormat = D3DFMT_X8R8G8B8;
+ if (!Windowed) {
g_PresentationParameters.FullScreen_PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
}
g_PresentationParameters.hDeviceWindow = hWnd;
Direct3DCreate8(SDKVersion = 220) = <pD3D>
IDirect3D8::GetDeviceCaps(this = <pD3D>, Adapter = D3DADAPTER_DEFAULT, DeviceType = D3DDEVTYPE_HAL, pCaps = &<Caps>) = D3D_OK
IDirect3D8::GetAdapterDisplayMode(this = <pD3D>, Adapter = D3DADAPTER_DEFAULT, pMode = &{Width = 1440, Height = 900, RefreshRate = 60, Format = D3DFMT_X8R8G8B8}) = D3D_OK
-IDirect3D8::CreateDevice(this = <pD3D>, Adapter = D3DADAPTER_DEFAULT, DeviceType = D3DDEVTYPE_HAL, hFocusWindow = <hWnd>, BehaviorFlags = D3DCREATE_HARDWARE_VERTEXPROCESSING, pPresentationParameters = &{BackBufferWidth = 0, BackBufferHeight = 0, BackBufferFormat = D3DFMT_X8R8G8B8, BackBufferCount = 1, MultiSampleType = D3DMULTISAMPLE_NONE, SwapEffect = D3DSWAPEFFECT_DISCARD, hDeviceWindow = <hWnd>, Windowed = TRUE, EnableAutoDepthStencil = FALSE, AutoDepthStencilFormat = D3DFMT_UNKNOWN, Flags = 0x0, FullScreen_RefreshRateInHz = 0, FullScreen_PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT}, ppReturnedDeviceInterface = &<pDevice>) = D3D_OK
+IDirect3D8::CreateDevice(this = <pD3D>, Adapter = D3DADAPTER_DEFAULT, DeviceType = D3DDEVTYPE_HAL, hFocusWindow = <hWnd>, BehaviorFlags = D3DCREATE_HARDWARE_VERTEXPROCESSING, pPresentationParameters = &{BackBufferWidth = 250, BackBufferHeight = 250, BackBufferFormat = <BackBufferFormat>, BackBufferCount = 1, MultiSampleType = D3DMULTISAMPLE_NONE, SwapEffect = D3DSWAPEFFECT_DISCARD, hDeviceWindow = <hWnd>, Windowed = TRUE, EnableAutoDepthStencil = FALSE, AutoDepthStencilFormat = D3DFMT_UNKNOWN, Flags = 0x0, FullScreen_RefreshRateInHz = 0, FullScreen_PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT}, ppReturnedDeviceInterface = &<pDevice>) = D3D_OK
IDirect3DDevice8::Clear(this = <pDevice>, Count = 0, pRects = NULL, Flags = D3DCLEAR_TARGET, Color = 0xff4c194c, Z = 1, Stencil = 0) = D3D_OK
IDirect3DDevice8::BeginScene(this = <pDevice>) = D3D_OK
IDirect3DDevice8::SetRenderState(this = <pDevice>, State = D3DRS_LIGHTING, Value = FALSE) = D3D_OK