summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/context.c6
-rw-r--r--src/mesa/main/context.h6
-rw-r--r--src/mesa/main/polygon.c18
-rw-r--r--src/mesa/main/texobj.c6
-rw-r--r--src/mesa/main/texstate.c32
-rw-r--r--src/mesa/main/varray.c20
6 files changed, 43 insertions, 45 deletions
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 15976dfa718..a1975bd00ca 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -1,4 +1,4 @@
-/* $Id: context.c,v 1.165 2002/06/13 04:31:09 brianp Exp $ */
+/* $Id: context.c,v 1.166 2002/06/13 04:49:17 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -2264,16 +2264,16 @@ _mesa_error( GLcontext *ctx, GLenum error, const char *where )
/*
* Call this to report debug information.
*/
-#ifdef DEBUG
void
_mesa_debug( const char *fmtString, ... )
{
+#ifdef DEBUG
va_list args;
va_start( args, fmtString );
(void) vfprintf( stderr, fmtString, args );
va_end( args );
-}
#endif
+}
void
diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h
index ac78b76ae57..23cd7e11047 100644
--- a/src/mesa/main/context.h
+++ b/src/mesa/main/context.h
@@ -1,4 +1,4 @@
-/* $Id: context.h,v 1.30 2002/06/13 04:31:09 brianp Exp $ */
+/* $Id: context.h,v 1.31 2002/06/13 04:49:17 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -237,10 +237,10 @@ _mesa_warning( const GLcontext *ctx, const char *s );
extern void
_mesa_error( GLcontext *ctx, GLenum error, const char *s );
-#ifdef DEBUG
extern void
_mesa_debug( const char *fmtString, ... );
-#endif
+
+
extern void
_mesa_Finish( void );
diff --git a/src/mesa/main/polygon.c b/src/mesa/main/polygon.c
index 910b8a35933..ee9eb3a7214 100644
--- a/src/mesa/main/polygon.c
+++ b/src/mesa/main/polygon.c
@@ -1,4 +1,4 @@
-/* $Id: polygon.c,v 1.21 2001/03/22 00:36:27 gareth Exp $ */
+/* $Id: polygon.c,v 1.22 2002/06/13 04:49:17 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -47,7 +47,7 @@ _mesa_CullFace( GLenum mode )
ASSERT_OUTSIDE_BEGIN_END(ctx);
if (MESA_VERBOSE&VERBOSE_API)
- fprintf(stderr, "glCullFace %s\n", _mesa_lookup_enum_by_nr(mode));
+ _mesa_debug("glCullFace %s\n", _mesa_lookup_enum_by_nr(mode));
if (mode!=GL_FRONT && mode!=GL_BACK && mode!=GL_FRONT_AND_BACK) {
_mesa_error( ctx, GL_INVALID_ENUM, "glCullFace" );
@@ -73,7 +73,7 @@ _mesa_FrontFace( GLenum mode )
ASSERT_OUTSIDE_BEGIN_END(ctx);
if (MESA_VERBOSE&VERBOSE_API)
- fprintf(stderr, "glFrontFace %s\n", _mesa_lookup_enum_by_nr(mode));
+ _mesa_debug("glFrontFace %s\n", _mesa_lookup_enum_by_nr(mode));
if (mode!=GL_CW && mode!=GL_CCW) {
_mesa_error( ctx, GL_INVALID_ENUM, "glFrontFace" );
@@ -101,9 +101,9 @@ _mesa_PolygonMode( GLenum face, GLenum mode )
ASSERT_OUTSIDE_BEGIN_END(ctx);
if (MESA_VERBOSE&VERBOSE_API)
- fprintf(stderr, "glPolygonMode %s %s\n",
- _mesa_lookup_enum_by_nr(face),
- _mesa_lookup_enum_by_nr(mode));
+ _mesa_debug("glPolygonMode %s %s\n",
+ _mesa_lookup_enum_by_nr(face),
+ _mesa_lookup_enum_by_nr(mode));
if (mode!=GL_POINT && mode!=GL_LINE && mode!=GL_FILL) {
_mesa_error( ctx, GL_INVALID_ENUM, "glPolygonMode(mode)" );
@@ -154,7 +154,7 @@ _mesa_PolygonStipple( const GLubyte *pattern )
ASSERT_OUTSIDE_BEGIN_END(ctx);
if (MESA_VERBOSE&VERBOSE_API)
- fprintf(stderr, "glPolygonStipple\n");
+ _mesa_debug("glPolygonStipple\n");
FLUSH_VERTICES(ctx, _NEW_POLYGONSTIPPLE);
_mesa_unpack_polygon_stipple(pattern, ctx->PolygonStipple, &ctx->Unpack);
@@ -172,7 +172,7 @@ _mesa_GetPolygonStipple( GLubyte *dest )
ASSERT_OUTSIDE_BEGIN_END(ctx);
if (MESA_VERBOSE&VERBOSE_API)
- fprintf(stderr, "glGetPolygonStipple\n");
+ _mesa_debug("glGetPolygonStipple\n");
_mesa_pack_polygon_stipple(ctx->PolygonStipple, dest, &ctx->Pack);
}
@@ -186,7 +186,7 @@ _mesa_PolygonOffset( GLfloat factor, GLfloat units )
ASSERT_OUTSIDE_BEGIN_END(ctx);
if (MESA_VERBOSE&VERBOSE_API)
- fprintf(stderr, "glPolygonOffset %f %f\n", factor, units);
+ _mesa_debug("glPolygonOffset %f %f\n", factor, units);
if (ctx->Polygon.OffsetFactor == factor &&
ctx->Polygon.OffsetUnits == units)
diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
index 39f65940b5d..a2d40956dfd 100644
--- a/src/mesa/main/texobj.c
+++ b/src/mesa/main/texobj.c
@@ -1,4 +1,4 @@
-/* $Id: texobj.c,v 1.52 2002/02/15 16:32:06 brianp Exp $ */
+/* $Id: texobj.c,v 1.53 2002/06/13 04:49:17 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -565,8 +565,8 @@ _mesa_BindTexture( GLenum target, GLuint texName )
ASSERT_OUTSIDE_BEGIN_END(ctx);
if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
- fprintf(stderr, "glBindTexture %s %d\n",
- _mesa_lookup_enum_by_nr(target), (GLint) texName);
+ _mesa_debug("glBindTexture %s %d\n",
+ _mesa_lookup_enum_by_nr(target), (GLint) texName);
switch (target) {
case GL_TEXTURE_1D:
diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c
index fe6d9157dee..464bd3adfd2 100644
--- a/src/mesa/main/texstate.c
+++ b/src/mesa/main/texstate.c
@@ -1,4 +1,4 @@
-/* $Id: texstate.c,v 1.72 2002/05/27 17:04:53 brianp Exp $ */
+/* $Id: texstate.c,v 1.73 2002/06/13 04:49:17 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -454,11 +454,11 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param )
}
if (MESA_VERBOSE&(VERBOSE_API|VERBOSE_TEXTURE))
- fprintf(stderr, "glTexEnv %s %s %.1f(%s) ...\n",
- _mesa_lookup_enum_by_nr(target),
- _mesa_lookup_enum_by_nr(pname),
- *param,
- _mesa_lookup_enum_by_nr((GLenum) (GLint) *param));
+ _mesa_debug("glTexEnv %s %s %.1f(%s) ...\n",
+ _mesa_lookup_enum_by_nr(target),
+ _mesa_lookup_enum_by_nr(pname),
+ *param,
+ _mesa_lookup_enum_by_nr((GLenum) (GLint) *param));
/* Tell device driver about the new texture environment */
if (ctx->Driver.TexEnv) {
@@ -950,10 +950,10 @@ _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params )
ASSERT_OUTSIDE_BEGIN_END(ctx);
if (MESA_VERBOSE&(VERBOSE_API|VERBOSE_TEXTURE))
- fprintf(stderr, "texPARAM %s %s %d...\n",
- _mesa_lookup_enum_by_nr(target),
- _mesa_lookup_enum_by_nr(pname),
- eparam);
+ _mesa_debug("texPARAM %s %s %d...\n",
+ _mesa_lookup_enum_by_nr(target),
+ _mesa_lookup_enum_by_nr(pname),
+ eparam);
switch (target) {
@@ -1764,10 +1764,10 @@ _mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params )
ASSERT_OUTSIDE_BEGIN_END(ctx);
if (MESA_VERBOSE&(VERBOSE_API|VERBOSE_TEXTURE))
- fprintf(stderr, "texGEN %s %s %x...\n",
- _mesa_lookup_enum_by_nr(coord),
- _mesa_lookup_enum_by_nr(pname),
- *(int *)params);
+ _mesa_debug("texGEN %s %s %x...\n",
+ _mesa_lookup_enum_by_nr(coord),
+ _mesa_lookup_enum_by_nr(pname),
+ *(int *)params);
switch (coord) {
case GL_S:
@@ -2303,8 +2303,8 @@ _mesa_ActiveTextureARB( GLenum target )
ASSERT_OUTSIDE_BEGIN_END(ctx);
if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
- fprintf(stderr, "glActiveTexture %s\n",
- _mesa_lookup_enum_by_nr(target));
+ _mesa_debug("glActiveTexture %s\n",
+ _mesa_lookup_enum_by_nr(target));
if (texUnit > ctx->Const.MaxTextureUnits) {
_mesa_error(ctx, GL_INVALID_ENUM, "glActiveTextureARB(target)");
diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
index f35e50c8724..4e03f21c873 100644
--- a/src/mesa/main/varray.c
+++ b/src/mesa/main/varray.c
@@ -1,4 +1,4 @@
-/* $Id: varray.c,v 1.43 2002/04/21 18:49:18 brianp Exp $ */
+/* $Id: varray.c,v 1.44 2002/06/13 04:49:17 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -60,7 +60,7 @@ _mesa_VertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr)
}
if (MESA_VERBOSE&(VERBOSE_VARRAY|VERBOSE_API))
- fprintf(stderr, "glVertexPointer( sz %d type %s stride %d )\n", size,
+ _mesa_debug("glVertexPointer( sz %d type %s stride %d )\n", size,
_mesa_lookup_enum_by_nr( type ),
stride);
@@ -112,7 +112,7 @@ _mesa_NormalPointer(GLenum type, GLsizei stride, const GLvoid *ptr )
}
if (MESA_VERBOSE&(VERBOSE_VARRAY|VERBOSE_API))
- fprintf(stderr, "glNormalPointer( type %s stride %d )\n",
+ _mesa_debug("glNormalPointer( type %s stride %d )\n",
_mesa_lookup_enum_by_nr( type ),
stride);
@@ -168,7 +168,7 @@ _mesa_ColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr)
}
if (MESA_VERBOSE&(VERBOSE_VARRAY|VERBOSE_API))
- fprintf(stderr, "glColorPointer( sz %d type %s stride %d )\n", size,
+ _mesa_debug("glColorPointer( sz %d type %s stride %d )\n", size,
_mesa_lookup_enum_by_nr( type ),
stride);
@@ -320,10 +320,8 @@ _mesa_SecondaryColorPointerEXT(GLint size, GLenum type,
}
if (MESA_VERBOSE&(VERBOSE_VARRAY|VERBOSE_API))
- fprintf(stderr,
- "glSecondaryColorPointer( sz %d type %s stride %d )\n", size,
- _mesa_lookup_enum_by_nr( type ),
- stride);
+ _mesa_debug("glSecondaryColorPointer( sz %d type %s stride %d )\n",
+ size, _mesa_lookup_enum_by_nr( type ), stride);
switch (type) {
case GL_BYTE:
@@ -389,7 +387,7 @@ _mesa_TexCoordPointer(GLint size, GLenum type, GLsizei stride,
}
if (MESA_VERBOSE&(VERBOSE_VARRAY|VERBOSE_API))
- fprintf(stderr, "glTexCoordPointer( unit %u sz %d type %s stride %d )\n",
+ _mesa_debug("glTexCoordPointer( unit %u sz %d type %s stride %d )\n",
texUnit,
size,
_mesa_lookup_enum_by_nr( type ),
@@ -770,7 +768,7 @@ _mesa_LockArraysEXT(GLint first, GLsizei count)
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
if (MESA_VERBOSE & VERBOSE_API)
- fprintf(stderr, "glLockArrays %d %d\n", first, count);
+ _mesa_debug("glLockArrays %d %d\n", first, count);
if (first == 0 && count > 0 &&
count <= (GLint) ctx->Const.MaxArrayLockSize) {
@@ -797,7 +795,7 @@ _mesa_UnlockArraysEXT( void )
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
if (MESA_VERBOSE & VERBOSE_API)
- fprintf(stderr, "glUnlockArrays\n");
+ _mesa_debug("glUnlockArrays\n");
ctx->Array.LockFirst = 0;
ctx->Array.LockCount = 0;