(D3D) Go through d3d_texture_new

This commit is contained in:
twinaphex 2014-09-13 18:42:13 +02:00
parent 978cc49563
commit c0f9c4ec41
2 changed files with 19 additions and 17 deletions

View File

@ -1401,14 +1401,15 @@ static bool d3d_overlay_load(void *data,
unsigned height = images[i].height; unsigned height = images[i].height;
overlay_t &overlay = d3d->overlays[i]; overlay_t &overlay = d3d->overlays[i];
if (FAILED(d3d->dev->CreateTexture( overlay.tex = (LPDIRECT3DTEXTURE)
width, d3d_texture_new(d3d->dev,
height, width, height, 1,
1,
0, 0,
D3DFMT_A8R8G8B8, D3DFMT_A8R8G8B8,
D3DPOOL_MANAGED, D3DPOOL_MANAGED, 0, 0, 0,
&overlay.tex, NULL))) NULL, NULL);
if (!overlay.tex)
{ {
RARCH_ERR("[D3D]: Failed to create overlay texture\n"); RARCH_ERR("[D3D]: Failed to create overlay texture\n");
return false; return false;
@ -1753,14 +1754,18 @@ static void d3d_set_menu_texture_frame(void *data,
if (d3d->menu) if (d3d->menu)
d3d_texture_free(d3d->menu->tex); d3d_texture_free(d3d->menu->tex);
if (FAILED(d3d->dev->CreateTexture(width, height, 1, d3d->menu_tex = (LPDIRECT3DTEXTURE)
0, D3DFMT_A8R8G8B8, d3d_texture_new(d3d->dev, NULL,
D3DPOOL_MANAGED, width, height, 1,
&d3d->menu->tex, NULL))) 0, D3DFMT_A8R8G8B8,
D3DPOOL_MANAGED, 0, 0, 0, NULL, NULL);
if (!d3d->menu_tex)
{ {
RARCH_ERR("[D3D]: Failed to create menu texture.\n"); RARCH_ERR("[D3D]: Failed to create menu texture.\n");
return; return;
} }
d3d->menu->tex_w = width; d3d->menu->tex_w = width;
d3d->menu->tex_h = height; d3d->menu->tex_h = height;
} }

View File

@ -70,15 +70,12 @@ static bool renderchain_create_first_pass(void *data,
if (!chain->vertex_buf) if (!chain->vertex_buf)
return false; return false;
ret = d3dr->CreateTexture(chain->tex_w, chain->tex_h, 1, 0, chain->tex = (LPDIRECT3DTEXTURE)d3d_texture_new(d3dr, NULL,
chain->tex_w, chain->tex_h, 1, 0,
info->rgb32 ? D3DFMT_LIN_X8R8G8B8 : D3DFMT_LIN_R5G6B5, info->rgb32 ? D3DFMT_LIN_X8R8G8B8 : D3DFMT_LIN_R5G6B5,
0, &chain->tex 0, 0, 0, 0, NULL, NULL);
#ifdef _XBOX360
, NULL
#endif
);
if (FAILED(ret)) if (!chain->tex)
return false; return false;
d3d_set_sampler_address_u(d3dr, D3DSAMP_ADDRESSU, D3DTADDRESS_BORDER); d3d_set_sampler_address_u(d3dr, D3DSAMP_ADDRESSU, D3DTADDRESS_BORDER);