src/render/direct3d/SDL_render_d3d.c
changeset 12900 9d3f245739f8
parent 12898 89b3e1e9839c
     1.1 --- a/src/render/direct3d/SDL_render_d3d.c	Fri Jun 21 10:58:30 2019 -0700
     1.2 +++ b/src/render/direct3d/SDL_render_d3d.c	Fri Jun 21 15:07:39 2019 -0400
     1.3 @@ -1223,7 +1223,7 @@
     1.4              IDirect3DVertexBuffer9_Release(vbo);
     1.5          }
     1.6  
     1.7 -        if (FAILED(IDirect3DDevice9_CreateVertexBuffer(data->device, (UINT) vertsize, usage, fvf, D3DPOOL_MANAGED, &vbo, NULL))) {
     1.8 +        if (FAILED(IDirect3DDevice9_CreateVertexBuffer(data->device, (UINT) vertsize, usage, fvf, D3DPOOL_DEFAULT, &vbo, NULL))) {
     1.9              vbo = NULL;
    1.10          }
    1.11          data->vertexBuffers[vboidx] = vbo;
    1.12 @@ -1550,6 +1550,13 @@
    1.13                  data->shaders[i] = NULL;
    1.14              }
    1.15          }
    1.16 +        /* Release all vertex buffers */
    1.17 +        for (i = 0; i < SDL_arraysize(data->vertexBuffers); ++i) {
    1.18 +            if (data->vertexBuffers[i]) {
    1.19 +                IDirect3DVertexBuffer9_Release(data->vertexBuffers[i]);
    1.20 +            }
    1.21 +            data->vertexBuffers[i] = NULL;
    1.22 +        }
    1.23          if (data->device) {
    1.24              IDirect3DDevice9_Release(data->device);
    1.25              data->device = NULL;
    1.26 @@ -1591,7 +1598,7 @@
    1.27          }
    1.28      }
    1.29  
    1.30 -	/* Release all vertex buffers */
    1.31 +    /* Release all vertex buffers */
    1.32      for (i = 0; i < SDL_arraysize(data->vertexBuffers); ++i) {
    1.33          if (data->vertexBuffers[i]) {
    1.34              IDirect3DVertexBuffer9_Release(data->vertexBuffers[i]);