Work around crash

This commit is contained in:
rdb 2009-04-18 13:14:42 +00:00
parent 8f01bbd3d9
commit 2a9bdfdcd2

View File

@ -329,10 +329,15 @@ add_render_texture(Texture *tex, RenderTextureMode mode,
tex->set_size_padded(get_x_size(), get_y_size());
if (mode == RTM_bind_or_copy) {
if (!_gsg->get_supports_render_texture() || !support_render_texture) {
// Binding is not supported or it is disabled, so just fall back
// to copy instead.
// Binding is not supported or it is disabled, so just fall back
// to copy instead.
if (!support_render_texture) {
mode = RTM_copy_texture;
} else {
nassertv(_gsg != NULL);
if (!_gsg->get_supports_render_texture()) {
mode = RTM_copy_texture;
}
}
}