(XDK D3D) Refactor LPDIRECT3D member to g_pD3D

This commit is contained in:
twinaphex 2014-03-05 06:11:39 +01:00
parent 1e37515e2f
commit 4cd603197b
3 changed files with 7 additions and 7 deletions

View File

@ -366,8 +366,8 @@ static bool gfx_ctx_xdk_init(void)
{
xdk_d3d_video_t *d3d = (xdk_d3d_video_t*)driver.video_data;
d3d->d3d_device = direct3d_create_ctx(D3D_SDK_VERSION);
if (!d3d->d3d_device)
d3d->g_pD3D = direct3d_create_ctx(D3D_SDK_VERSION);
if (!d3d->g_pD3D)
{
RARCH_ERR("Could not create Direct3D context.\n");
free(d3d);
@ -394,9 +394,9 @@ static void gfx_ctx_xdk_destroy(void)
d3d->dev->Release();
d3d->dev = 0;
if (d3d->d3d_device)
d3d->d3d_device->Release();
d3d->d3d_device = 0;
if (d3d->g_pD3D)
d3d->g_pD3D->Release();
d3d->g_pD3D = 0;
}
static void gfx_ctx_xdk_input_driver(const input_driver_t **input, void **input_data)

View File

@ -422,7 +422,7 @@ static void *xdk_d3d_init(const video_info_t *video, const input_driver_t **inpu
D3DPRESENT_PARAMETERS d3dpp;
xdk_d3d_generate_pp(&d3dpp, video);
ret = d3d->d3d_device->CreateDevice(0, D3DDEVTYPE_HAL, NULL, D3DCREATE_HARDWARE_VERTEXPROCESSING,
ret = d3d->g_pD3D->CreateDevice(0, D3DDEVTYPE_HAL, NULL, D3DCREATE_HARDWARE_VERTEXPROCESSING,
&d3dpp, &d3d->dev);
if (ret != S_OK)

View File

@ -56,7 +56,7 @@ typedef struct xdk_d3d_video
unsigned win_width;
unsigned win_height;
unsigned tex_w, tex_h;
LPDIRECT3D d3d_device;
LPDIRECT3D g_pD3D;
LPDIRECT3DDEVICE dev;
LPDIRECT3DVERTEXBUFFER vertex_buf;
LPDIRECT3DTEXTURE lpTexture;