From 87cfee27d0ad5d3525280a8620d2e7fb5572d108 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Mon, 27 Jan 2014 16:10:15 -0500 Subject: [PATCH] Patched to compile on Windows when not supporting Direct3D. --- src/render/direct3d/SDL_render_d3d.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/render/direct3d/SDL_render_d3d.c b/src/render/direct3d/SDL_render_d3d.c index 74dbea2f5..87edadc83 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: */