summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2004-12-21 15:13:41 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2004-12-21 15:13:41 +0000
commit3ec0631e955cb79cf6009e391cd9b4f6a263b989 (patch)
tree65dbf3ebeff21bead457191d1a096fe760084954
parent50694eeff993043df45b6343eb853d92589946a5 (diff)
fix bug in _mesa_IsTexture()
-rw-r--r--src/mesa/main/texobj.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
index 079a0607c6..4c2fd1017c 100644
--- a/src/mesa/main/texobj.c
+++ b/src/mesa/main/texobj.c
@@ -1021,9 +1021,18 @@ _mesa_AreTexturesResident(GLsizei n, const GLuint *texName,
GLboolean GLAPIENTRY
_mesa_IsTexture( GLuint texture )
{
+ struct gl_texture_object *t;
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
- return texture > 0 && _mesa_HashLookup(ctx->Shared->TexObjects, texture);
+
+ if (!t)
+ return GL_FALSE;
+
+ t = (struct gl_texture_object *)
+ _mesa_HashLookup(ctx->Shared->TexObjects, texture);
+
+ /* IsTexture is true only after object has been bound once. */
+ return t && t->Target;
}
/*@}*/