mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
Fix framebuffer_copy_to_ram function.
GetRenderTargetData function requires the target buffer size to be the same size as the backbuffer.
This commit is contained in:
parent
abd1a41291
commit
d149ca28bb
@ -1569,12 +1569,18 @@ framebuffer_copy_to_ram(Texture *tex, int z, const DisplayRegion *dr, const Rend
|
|||||||
// need to copy it to a temporary surface of the appropriate type
|
// need to copy it to a temporary surface of the appropriate type
|
||||||
// first.
|
// first.
|
||||||
D3DPOOL pool;
|
D3DPOOL pool;
|
||||||
|
D3DSURFACE_DESC surface_description;
|
||||||
|
|
||||||
|
backbuffer -> GetDesc (&surface_description);
|
||||||
|
|
||||||
pool = D3DPOOL_SYSTEMMEM;
|
pool = D3DPOOL_SYSTEMMEM;
|
||||||
hr = _d3d_device->CreateOffscreenPlainSurface(w, h, _screen->_display_mode.Format,
|
hr = _d3d_device->CreateOffscreenPlainSurface(
|
||||||
pool,
|
surface_description.Width,
|
||||||
&temp_surface,
|
surface_description.Height,
|
||||||
NULL);
|
surface_description.Format,
|
||||||
|
pool,
|
||||||
|
&temp_surface,
|
||||||
|
NULL);
|
||||||
if (FAILED(hr)) {
|
if (FAILED(hr)) {
|
||||||
dxgsg9_cat.error()
|
dxgsg9_cat.error()
|
||||||
<< "CreateImageSurface failed in copy_pixel_buffer()"
|
<< "CreateImageSurface failed in copy_pixel_buffer()"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user