From 5050c994e06cc7da0544ef811a7b6635b141702b Mon Sep 17 00:00:00 2001 From: David Rose Date: Thu, 28 Aug 2008 00:45:30 +0000 Subject: [PATCH] create texture property in copy_to_texture --- panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx | 6 ++++++ panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx b/panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx index 2c22033c3a..e6dbec7da3 100644 --- a/panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx +++ b/panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx @@ -1484,6 +1484,12 @@ framebuffer_copy_to_texture(Texture *tex, int z, const DisplayRegion *dr, return false; } DXTextureContext8 *dtc = DCAST(DXTextureContext8, tc); + if (!dtc->create_texture(*_screen)) { + // Oops, we can't re-create the texture for some reason. + dxgsg8_cat.error() + << "Unable to re-create texture " << *dtc->get_texture() << endl; + return false; + } if (tex->get_texture_type() != Texture::TT_2d_texture) { // For a specialty texture like a cube map, go the slow route diff --git a/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx b/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx index b2354f3d2f..a3c7366169 100755 --- a/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx +++ b/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx @@ -2138,6 +2138,12 @@ framebuffer_copy_to_texture(Texture *tex, int z, const DisplayRegion *dr, return false; } DXTextureContext9 *dtc = DCAST(DXTextureContext9, tc); + if (!dtc->create_texture(*_screen)) { + // Oops, we can't re-create the texture for some reason. + dxgsg9_cat.error() + << "Unable to re-create texture " << *dtc->get_texture() << endl; + return false; + } if (tex->get_texture_type() != Texture::TT_2d_texture) { // For a specialty texture like a cube map, go the slow route