From 33eca53d00b4642da67d9d1ce50a2f30f9f4fe56 Mon Sep 17 00:00:00 2001 From: David Rose Date: Tue, 6 May 2008 15:27:17 +0000 Subject: [PATCH] fix cubemap bug --- panda/src/glstuff/glGraphicsStateGuardian_src.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index 65e1d865a3..d57f9fe117 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -3552,18 +3552,22 @@ framebuffer_copy_to_ram(Texture *tex, int z, const DisplayRegion *dr, } Texture::TextureType texture_type; + int z_size; if (z >= 0) { texture_type = Texture::TT_cube_map; + z_size = 6; } else { texture_type = Texture::TT_2d_texture; + z_size = 1; } if (tex->get_x_size() != w || tex->get_y_size() != h || + tex->get_z_size() != z_size || tex->get_component_type() != component_type || tex->get_format() != format || tex->get_texture_type() != texture_type) { // Re-setup the texture; its properties have changed. - tex->setup_texture(texture_type, w, h, tex->get_z_size(), + tex->setup_texture(texture_type, w, h, z_size, component_type, format); }