src/render/direct3d/SDL_render_d3d.c
changeset 6895 031a1fd143ec
parent 6885 700f1b25f77f
child 6968 959d9bbbbea0
equal deleted inserted replaced
6894:5b5329b1576f 6895:031a1fd143ec
   360 {
   360 {
   361     D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata;
   361     D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata;
   362     HRESULT result;
   362     HRESULT result;
   363 
   363 
   364     /* Release the default render target before reset */
   364     /* Release the default render target before reset */
   365     IDirect3DSurface9_Release(data->defaultRenderTarget);
   365     if (data->defaultRenderTarget) {
       
   366         IDirect3DSurface9_Release(data->defaultRenderTarget);
       
   367         data->defaultRenderTarget = NULL;
       
   368     }
   366 
   369 
   367     result = IDirect3DDevice9_Reset(data->device, &data->pparams);
   370     result = IDirect3DDevice9_Reset(data->device, &data->pparams);
   368     if (FAILED(result)) {
   371     if (FAILED(result)) {
   369         if (result == D3DERR_DEVICELOST) {
   372         if (result == D3DERR_DEVICELOST) {
   370             /* Don't worry about it, we'll reset later... */
   373             /* Don't worry about it, we'll reset later... */
  1484 {
  1487 {
  1485     D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata;
  1488     D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata;
  1486 
  1489 
  1487     if (data) {
  1490     if (data) {
  1488         // Release the render target
  1491         // Release the render target
  1489         IDirect3DSurface9_Release(data->defaultRenderTarget);
  1492         if (data->defaultRenderTarget) {
       
  1493             IDirect3DSurface9_Release(data->defaultRenderTarget);
       
  1494             data->defaultRenderTarget = NULL;
       
  1495         }
  1490         if (data->currentRenderTarget != NULL) {
  1496         if (data->currentRenderTarget != NULL) {
  1491             IDirect3DSurface9_Release(data->currentRenderTarget);
  1497             IDirect3DSurface9_Release(data->currentRenderTarget);
  1492             data->currentRenderTarget = NULL;
  1498             data->currentRenderTarget = NULL;
  1493         }
  1499         }
  1494         
  1500