mirror of
https://github.com/CTCaer/RetroArch.git
synced 2024-12-16 23:37:11 +00:00
Create d3d_device_create_offscreen_plain_surface
This commit is contained in:
parent
95ca5a3876
commit
0559be4e72
@ -271,6 +271,23 @@ void d3d_set_stream_source(LPDIRECT3DDEVICE dev, unsigned stream_no,
|
||||
#endif
|
||||
}
|
||||
|
||||
bool d3d_device_create_offscreen_plain_surface(
|
||||
LPDIRECT3DDEVICE dev,
|
||||
unsigned width,
|
||||
unsigned height,
|
||||
unsigned format,
|
||||
unsigned pool,
|
||||
void **surf_data,
|
||||
void *data)
|
||||
{
|
||||
if (FAILED(dev->CreateOffscreenPlainSurface(width, height,
|
||||
(D3DFORMAT)format, (D3DPOOL)pool,
|
||||
(LPDIRECT3DSURFACE*)surf_data,
|
||||
(HANDLE*)data)))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
static void d3d_set_texture_stage_state(LPDIRECT3DDEVICE dev,
|
||||
unsigned sampler, unsigned value, unsigned type)
|
||||
{
|
||||
|
@ -124,6 +124,15 @@ void d3d_set_render_state(void *data, D3DRENDERSTATETYPE state, DWORD value);
|
||||
void d3d_device_set_render_target(LPDIRECT3DDEVICE dev, unsigned idx,
|
||||
void *data);
|
||||
|
||||
bool d3d_device_create_offscreen_plain_surface(
|
||||
LPDIRECT3DDEVICE dev,
|
||||
unsigned width,
|
||||
unsigned height,
|
||||
unsigned format,
|
||||
unsigned pool,
|
||||
void **surf_data,
|
||||
void *data);
|
||||
|
||||
bool d3d_reset(LPDIRECT3DDEVICE dev, D3DPRESENT_PARAMETERS *d3dpp);
|
||||
|
||||
void d3d_device_free(LPDIRECT3DDEVICE dev, LPDIRECT3D pd3d);
|
||||
|
@ -1547,25 +1547,16 @@ static bool d3d9_cg_renderchain_read_viewport(
|
||||
|
||||
video_driver_get_size(&width, &height);
|
||||
|
||||
(void)d3d;
|
||||
(void)data;
|
||||
(void)buffer;
|
||||
|
||||
if (!d3d_device_get_render_target(d3dr, 0, (void**)&target))
|
||||
{
|
||||
ret = false;
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (FAILED(d3d->d3d_err = d3dr->CreateOffscreenPlainSurface(
|
||||
width, height,
|
||||
D3DFMT_X8R8G8B8, D3DPOOL_SYSTEMMEM,
|
||||
&dest, NULL)))
|
||||
{
|
||||
ret = false;
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (!d3d_device_get_render_target_data(d3dr, (void*)target, (void*)dest))
|
||||
if (
|
||||
!d3d_device_get_render_target(d3dr, 0, (void**)&target) ||
|
||||
!d3d_device_create_offscreen_plain_surface(d3dr, width, height,
|
||||
D3DFMT_X8R8G8B8, D3DPOOL_SYSTEMMEM, (void**)&dest, NULL) ||
|
||||
!d3d_device_get_render_target_data(d3dr, (void*)target, (void*)dest)
|
||||
)
|
||||
{
|
||||
ret = false;
|
||||
goto end;
|
||||
|
Loading…
Reference in New Issue
Block a user