return d3d->vblank;
}
-static void xD3D11_initvals(HWND ahwnd, int monid, int w_w, int w_h, int t_w, int t_h, int depth, int *freq, int mmulth, int mmultv)
+static bool xD3D11_initvals(HWND ahwnd, int monid, int w_w, int w_h, int t_w, int t_h, int depth, int *freq, int mmulth, int mmultv, bool doalloc)
{
struct d3d11struct *d3d = &d3d11data[monid];
+ bool changed = false;
+ if (d3d->m_screenWidth != w_w || d3d->m_screenHeight != w_h) {
+ changed = true;
+ }
+ if (doalloc && !changed && (d3d->m_bitmapWidth != t_w || d3d->m_bitmapHeight != t_h || d3d->dmultxh != mmulth || d3d->dmultxv != mmultv)) {
+ d3d->m_bitmapWidth = t_w;
+ d3d->m_bitmapHeight = t_h;
+ d3d->dmultxh = mmulth;
+ d3d->dmultxv = mmultv;
+ D3D_alloctexture(monid, t_w, t_h);
+ }
d3d->m_bitmapWidth = t_w;
d3d->m_bitmapHeight = t_h;
d3d->m_screenWidth = w_w;
d3d->m_screenHeight = w_h;
d3d->dmultxh = mmulth;
d3d->dmultxv = mmultv;
+
+ return changed;
}
static int xxD3D11_init2(HWND ahwnd, int monid, int w_w, int w_h, int t_w, int t_h, int depth, int *freq, int mmulth, int mmultv)
return 0;
}
- xD3D11_initvals(ahwnd, monid, w_w, w_h, t_w, t_h, depth, freq, mmulth, mmultv);
+ xD3D11_initvals(ahwnd, monid, w_w, w_h, t_w, t_h, depth, freq, mmulth, mmultv, false);
d3d->ahwnd = ahwnd;
return _T("D3D11 INITIALIZATION ERROR");
} else {
struct d3d11struct *d3d = &d3d11data[monid];
- xD3D11_initvals(ahwnd, monid, w_w, w_h, w_w, w_h, depth, freq, mmulth, mmultv);
- d3d->fsresizedo = true;
+ if (xD3D11_initvals(ahwnd, monid, w_w, w_h, w_w, w_h, depth, freq, mmulth, mmultv, true)) {
+ d3d->fsresizedo = true;
+ }
return NULL;
}
}