diff --git a/gfx/common/d3d_common.c b/gfx/common/d3d_common.c index 3e9ffa243e..6ac2285698 100644 --- a/gfx/common/d3d_common.c +++ b/gfx/common/d3d_common.c @@ -28,6 +28,15 @@ #include #endif +void *d3d_create(void) +{ +#if defined(HAVE_D3D9) + return Direct3DCreate9(D3D_SDK_VERSION); +#elif defined(HAVE_D3D8) + return Direct3DCreate8(D3D_SDK_VERSION); +#endif +} + bool d3d_swap(void *data, LPDIRECT3DDEVICE dev) { #if defined(_XBOX1) diff --git a/gfx/common/d3d_common.h b/gfx/common/d3d_common.h index 87fa7c03ed..93664aac50 100644 --- a/gfx/common/d3d_common.h +++ b/gfx/common/d3d_common.h @@ -173,6 +173,8 @@ bool d3d_device_get_backbuffer(LPDIRECT3DDEVICE dev, void d3d_device_free(LPDIRECT3DDEVICE dev, LPDIRECT3D pd3d); +void *d3d_create(void); + D3DTEXTUREFILTERTYPE d3d_translate_filter(unsigned type); RETRO_END_DECLS diff --git a/gfx/drivers/d3d.c b/gfx/drivers/d3d.c index 8e65fcbd7f..59a00896ed 100644 --- a/gfx/drivers/d3d.c +++ b/gfx/drivers/d3d.c @@ -637,7 +637,8 @@ static bool d3d_init_base(void *data, const video_info_t *info) d3d_make_d3dpp(d3d, info, &d3dpp); - g_pD3D = D3DCREATE_CTX(D3D_SDK_VERSION); + g_pD3D = (LPDIRECT3D)d3d_create(); + if (!g_pD3D) { RARCH_ERR("[D3D]: Failed to create D3D interface.\n");