From 4da1d1f8a3c6dd124ec6d9e4979d5120cd6d3e14 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 8 Mar 2014 05:21:36 +0100 Subject: [PATCH] (D3D CTX) implement gfx_ctx_d3d_destroy for Xbox --- gfx/context/d3d_ctx.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/gfx/context/d3d_ctx.c b/gfx/context/d3d_ctx.c index 01e6c2437a..07427b8a21 100644 --- a/gfx/context/d3d_ctx.c +++ b/gfx/context/d3d_ctx.c @@ -312,6 +312,21 @@ static bool gfx_ctx_d3d_init(void) return true; } +static void gfx_ctx_d3d_destroy(void) +{ +#ifdef _XBOX + d3d_video_t * d3d = (d3d_video_t*)driver.video_data; + + if (d3d->dev) + d3d->dev->Release(); + d3d->dev = 0; + + if (d3d->g_pD3D) + d3d->g_pD3D->Release(); + d3d->g_pD3D = 0; +#endif +} + static void gfx_ctx_d3d_input_driver(const input_driver_t **input, void **input_data) { #ifdef _XBOX @@ -437,10 +452,10 @@ static void gfx_ctx_d3d_swap_interval(unsigned interval) const gfx_ctx_driver_t gfx_ctx_d3d9 = { gfx_ctx_d3d_init, - NULL, // gfx_ctx_destroy + gfx_ctx_d3d_destroy, gfx_ctx_d3d_bind_api, gfx_ctx_d3d_swap_interval, - NULL, // gfx_ctx_set_video_mode + NULL, gfx_ctx_d3d_get_video_size, NULL, gfx_ctx_d3d_update_title,