fix GL texture state change, DX texture reload

This commit is contained in:
David Rose 2006-04-13 22:56:38 +00:00
parent d2e1cb779d
commit 34064f07ad
4 changed files with 5 additions and 1 deletions

View File

@ -84,7 +84,6 @@ create_texture(DXScreenData &scrn) {
nassertr(IS_VALID_PTR(get_texture()), false);
delete_texture();
mark_loaded();
#ifdef DO_PSTATS
update_data_size_bytes(get_texture()->estimate_texture_memory());
@ -695,6 +694,7 @@ create_texture(DXScreenData &scrn) {
}
get_texture()->texture_uploaded();
mark_loaded();
return true;
error_exit:

View File

@ -837,6 +837,7 @@ create_texture(DXScreenData &scrn) {
}
get_texture()->texture_uploaded();
}
mark_loaded();
return true;

View File

@ -6558,6 +6558,7 @@ upload_texture(CLP(TextureContext) *gtc) {
if (success) {
gtc->_already_applied = true;
gtc->_uses_mipmaps = uses_mipmaps;
gtc->_internal_format = internal_format;
gtc->_width = width;
gtc->_height = height;
@ -6673,6 +6674,7 @@ upload_texture_image(CLP(TextureContext) *gtc,
if (!gtc->_already_applied ||
gtc->_uses_mipmaps != uses_mipmaps ||
gtc->_internal_format != internal_format ||
gtc->_width != width ||
gtc->_height != height ||

View File

@ -36,6 +36,7 @@ public:
// glTexImage2D() call. If none of these have changed, we can
// reload the texture image with a glTexSubImage2D().
bool _already_applied;
bool _uses_mipmaps;
GLint _internal_format;
GLsizei _width;
GLsizei _height;