src/render/direct3d/SDL_render_d3d.c
changeset 7763 fc802d707136
parent 7762 51abf7664304
child 7764 0f48b5f28668
--- a/src/render/direct3d/SDL_render_d3d.c	Sat Sep 28 14:06:59 2013 -0700
+++ b/src/render/direct3d/SDL_render_d3d.c	Sat Sep 28 14:07:05 2013 -0700
@@ -1875,6 +1875,19 @@
     SDL_free(renderer);
 }
 
+IDirect3DDevice9 *
+SDL_RenderGetD3DDevice(SDL_Renderer * renderer)
+{
+	D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata;
+
+	// Make sure that this is a D3D renderer
+	if (renderer->DestroyRenderer != D3D_DestroyRenderer) {
+		SDL_SetError("Renderer is not a D3D renderer");
+		return NULL;
+	}
+	return data->device;
+}
+
 #endif /* SDL_VIDEO_RENDER_D3D && !SDL_RENDER_DISABLED */
 
 /* vi: set ts=4 sw=4 expandtab: */