src/render/direct3d/SDL_render_d3d.c
changeset 8130 506eb1e0ae85
parent 8093 b43765095a6f
child 8131 311302021bc9
equal deleted inserted replaced
8129:47f67902b179 8130:506eb1e0ae85
  1888         }
  1888         }
  1889         SDL_free(data);
  1889         SDL_free(data);
  1890     }
  1890     }
  1891     SDL_free(renderer);
  1891     SDL_free(renderer);
  1892 }
  1892 }
  1893 
  1893 #endif /* SDL_VIDEO_RENDER_D3D && !SDL_RENDER_DISABLED */
       
  1894 
       
  1895 /* This function needs to always exist for the Dynamic API. */
  1894 IDirect3DDevice9 *
  1896 IDirect3DDevice9 *
  1895 SDL_RenderGetD3D9Device(SDL_Renderer * renderer)
  1897 SDL_RenderGetD3D9Device(SDL_Renderer * renderer)
  1896 {
  1898 {
       
  1899     IDirect3DDevice9 *device = NULL;
       
  1900 
       
  1901 #if SDL_VIDEO_RENDER_D3D && !SDL_RENDER_DISABLED
  1897     D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata;
  1902     D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata;
  1898     IDirect3DDevice9 *device;
       
  1899 
  1903 
  1900     // Make sure that this is a D3D renderer
  1904     // Make sure that this is a D3D renderer
  1901     if (renderer->DestroyRenderer != D3D_DestroyRenderer) {
  1905     if (renderer->DestroyRenderer != D3D_DestroyRenderer) {
  1902         SDL_SetError("Renderer is not a D3D renderer");
  1906         SDL_SetError("Renderer is not a D3D renderer");
  1903         return NULL;
  1907         return NULL;
  1905 
  1909 
  1906     device = data->device;
  1910     device = data->device;
  1907     if (device) {
  1911     if (device) {
  1908         IDirect3DDevice9_AddRef( device );
  1912         IDirect3DDevice9_AddRef( device );
  1909     }
  1913     }
       
  1914 #endif /* SDL_VIDEO_RENDER_D3D && !SDL_RENDER_DISABLED */
       
  1915 
  1910     return device;
  1916     return device;
  1911 }
  1917 }
  1912 
  1918 
  1913 #endif /* SDL_VIDEO_RENDER_D3D && !SDL_RENDER_DISABLED */
       
  1914 
       
  1915 /* vi: set ts=4 sw=4 expandtab: */
  1919 /* vi: set ts=4 sw=4 expandtab: */