Commit 87cfee27d0ad5d3525280a8620d2e7fb5572d108

Ryan C. Gordon 2014-01-27T16:10:15

Patched to compile on Windows when not supporting Direct3D.

diff --git a/src/render/direct3d/SDL_render_d3d.c b/src/render/direct3d/SDL_render_d3d.c
index 74dbea2..87edadc 100644
--- a/src/render/direct3d/SDL_render_d3d.c
+++ b/src/render/direct3d/SDL_render_d3d.c
@@ -1890,12 +1890,16 @@ D3D_DestroyRenderer(SDL_Renderer * renderer)
     }
     SDL_free(renderer);
 }
+#endif /* SDL_VIDEO_RENDER_D3D && !SDL_RENDER_DISABLED */
 
+/* This function needs to always exist for the Dynamic API. */
 IDirect3DDevice9 *
 SDL_RenderGetD3D9Device(SDL_Renderer * renderer)
 {
+    IDirect3DDevice9 *device = NULL;
+
+#if SDL_VIDEO_RENDER_D3D && !SDL_RENDER_DISABLED
     D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata;
-    IDirect3DDevice9 *device;
 
     // Make sure that this is a D3D renderer
     if (renderer->DestroyRenderer != D3D_DestroyRenderer) {
@@ -1907,9 +1911,9 @@ SDL_RenderGetD3D9Device(SDL_Renderer * renderer)
     if (device) {
         IDirect3DDevice9_AddRef( device );
     }
+#endif /* SDL_VIDEO_RENDER_D3D && !SDL_RENDER_DISABLED */
+
     return device;
 }
 
-#endif /* SDL_VIDEO_RENDER_D3D && !SDL_RENDER_DISABLED */
-
 /* vi: set ts=4 sw=4 expandtab: */