summaryrefslogtreecommitdiff
path: root/src/mesa/main/matrix.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2004-03-13 16:32:58 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2004-03-13 16:32:58 +0000
commit5498e8b9f34718aba506421988116ccb1e5e3de7 (patch)
tree8a8792e6d6e877f5f20793084fe9e71e1e10f83f /src/mesa/main/matrix.c
parent6ddfdff659196cf4eeb0e5fed70ddd1ced0d16fc (diff)
more descriptive error messages for matrix stack over/underflows
Diffstat (limited to 'src/mesa/main/matrix.c')
-rw-r--r--src/mesa/main/matrix.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/src/mesa/main/matrix.c b/src/mesa/main/matrix.c
index 76ca28451f..8204c258a6 100644
--- a/src/mesa/main/matrix.c
+++ b/src/mesa/main/matrix.c
@@ -10,9 +10,9 @@
/*
* Mesa 3-D graphics library
- * Version: 5.1
+ * Version: 6.1
*
- * Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -234,7 +234,15 @@ _mesa_PushMatrix( void )
_mesa_lookup_enum_by_nr(ctx->Transform.MatrixMode));
if (stack->Depth + 1 >= stack->MaxDepth) {
- _mesa_error( ctx, GL_STACK_OVERFLOW, "glPushMatrix" );
+ if (ctx->Transform.MatrixMode == GL_TEXTURE) {
+ _mesa_error(ctx, GL_STACK_OVERFLOW,
+ "glPushMatrix(mode=GL_TEXTURE, unit=%d)",
+ ctx->Texture.CurrentUnit);
+ }
+ else {
+ _mesa_error(ctx, GL_STACK_OVERFLOW, "glPushMatrix(mode=%s)",
+ _mesa_lookup_enum_by_nr(ctx->Transform.MatrixMode));
+ }
return;
}
_math_matrix_copy( &stack->Stack[stack->Depth + 1],
@@ -266,7 +274,15 @@ _mesa_PopMatrix( void )
_mesa_lookup_enum_by_nr(ctx->Transform.MatrixMode));
if (stack->Depth == 0) {
- _mesa_error( ctx, GL_STACK_UNDERFLOW, "glPopMatrix" );
+ if (ctx->Transform.MatrixMode == GL_TEXTURE) {
+ _mesa_error(ctx, GL_STACK_UNDERFLOW,
+ "glPopMatrix(mode=GL_TEXTURE, unit=%d)",
+ ctx->Texture.CurrentUnit);
+ }
+ else {
+ _mesa_error(ctx, GL_STACK_UNDERFLOW, "glPopMatrix(mode=%s)",
+ _mesa_lookup_enum_by_nr(ctx->Transform.MatrixMode));
+ }
return;
}
stack->Depth--;