mirror of
https://github.com/CTCaer/RetroArch.git
synced 2024-12-16 23:37:11 +00:00
Add d3d_device_get_backbuffer
This commit is contained in:
parent
dbd2faf69a
commit
6e22e2b4fc
@ -939,6 +939,45 @@ bool d3d_reset(LPDIRECT3DDEVICE dev, D3DPRESENT_PARAMETERS *d3dpp)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool d3d_device_get_backbuffer(LPDIRECT3DDEVICE dev,
|
||||
unsigned idx, unsigned swapchain_idx,
|
||||
unsigned backbuffer_type, void **data)
|
||||
{
|
||||
if (!dev)
|
||||
return false;
|
||||
|
||||
#if defined(HAVE_D3D9) && !defined(__cplusplus)
|
||||
#ifdef __cplusplus
|
||||
if (SUCCEEDED(dev->GetBackBuffer(
|
||||
swapchain_idx, idx,
|
||||
(D3DBACKBUFFER_TYPE)backbuffer_type,
|
||||
(LPDIRECT3DSURFACE*)data)))
|
||||
return true;
|
||||
#else
|
||||
if (SUCCEEDED(IDirect3DDevice9_GetBackBuffer(dev,
|
||||
swapchain_idx, idx,
|
||||
(D3DBACKBUFFER_TYPE)backbuffer_type,
|
||||
(LPDIRECT3DSURFACE*)data)))
|
||||
return true;
|
||||
#endif
|
||||
#elif defined(HAVE_D3D8)
|
||||
#ifdef __cplusplus
|
||||
if (SUCCEEDED(dev->GetBackBuffer(idx,
|
||||
(D3DBACKBUFFER_TYPE)backbuffer_type,
|
||||
(LPDIRECT3DSURFACE*)data)))
|
||||
return true;
|
||||
#else
|
||||
if (SUCCEEDED(IDirect3DDevice8_GetBackBuffer(dev, idx,
|
||||
(D3DBACKBUFFER_TYPE)backbuffer_type,
|
||||
(LPDIRECT3DSURFACE*)data)))
|
||||
return true;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void d3d_device_free(LPDIRECT3DDEVICE dev, LPDIRECT3D pd3d)
|
||||
{
|
||||
if (dev)
|
||||
|
@ -167,6 +167,10 @@ bool d3d_create_device(LPDIRECT3DDEVICE *dev,
|
||||
|
||||
bool d3d_reset(LPDIRECT3DDEVICE dev, D3DPRESENT_PARAMETERS *d3dpp);
|
||||
|
||||
bool d3d_device_get_backbuffer(LPDIRECT3DDEVICE dev,
|
||||
unsigned idx, unsigned swapchain_idx,
|
||||
unsigned backbuffer_type, void **data);
|
||||
|
||||
void d3d_device_free(LPDIRECT3DDEVICE dev, LPDIRECT3D pd3d);
|
||||
|
||||
D3DTEXTUREFILTERTYPE d3d_translate_filter(unsigned type);
|
||||
|
Loading…
Reference in New Issue
Block a user