mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-16 11:06:49 +01:00
direct3d: Release and NULL out vertex buffers on reset.
Otherwise they are irretrievably lost on window resize, etc, which makes rendering freeze and other disasters. Fixes Bugzilla #4358.
This commit is contained in:
parent
d4a21f54b8
commit
3c9361509b
@ -1566,6 +1566,15 @@ D3D_Reset(SDL_Renderer * renderer)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Release all vertex buffers */
|
||||||
|
int i;
|
||||||
|
for (i = 0; i < SDL_arraysize(data->vertexBuffers); ++i) {
|
||||||
|
if (data->vertexBuffers[i]) {
|
||||||
|
IDirect3DVertexBuffer9_Release(data->vertexBuffers[i]);
|
||||||
|
}
|
||||||
|
data->vertexBuffers[i] = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
result = IDirect3DDevice9_Reset(data->device, &data->pparams);
|
result = IDirect3DDevice9_Reset(data->device, &data->pparams);
|
||||||
if (FAILED(result)) {
|
if (FAILED(result)) {
|
||||||
if (result == D3DERR_DEVICELOST) {
|
if (result == D3DERR_DEVICELOST) {
|
||||||
|
Loading…
Reference in New Issue
Block a user