- 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;