Removed DD_Z_NEVER.
[mesa.git] / src / mesa / main / debug.c
1 /* $Id: debug.c,v 1.10 2001/03/29 16:50:31 brianp Exp $ */
2
3 /*
4 * Mesa 3-D graphics library
5 * Version: 3.5
6 *
7 * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
8 *
9 * Permission is hereby granted, free of charge, to any person obtaining a
10 * copy of this software and associated documentation files (the "Software"),
11 * to deal in the Software without restriction, including without limitation
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
15 *
16 * The above copyright notice and this permission notice shall be included
17 * in all copies or substantial portions of the Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
23 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 */
26
27 #include "mtypes.h"
28 #include "debug.h"
29
30 void _mesa_print_state( const char *msg, GLuint state )
31 {
32 fprintf(stderr,
33 "%s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
34 msg,
35 state,
36 (state & _NEW_MODELVIEW) ? "ctx->ModelView, " : "",
37 (state & _NEW_PROJECTION) ? "ctx->Projection, " : "",
38 (state & _NEW_TEXTURE_MATRIX) ? "ctx->TextureMatrix, " : "",
39 (state & _NEW_COLOR_MATRIX) ? "ctx->ColorMatrix, " : "",
40 (state & _NEW_ACCUM) ? "ctx->Accum, " : "",
41 (state & _NEW_COLOR) ? "ctx->Color, " : "",
42 (state & _NEW_DEPTH) ? "ctx->Depth, " : "",
43 (state & _NEW_EVAL) ? "ctx->Eval/EvalMap, " : "",
44 (state & _NEW_FOG) ? "ctx->Fog, " : "",
45 (state & _NEW_HINT) ? "ctx->Hint, " : "",
46 (state & _NEW_LIGHT) ? "ctx->Light, " : "",
47 (state & _NEW_LINE) ? "ctx->Line, " : "",
48 (state & _NEW_PIXEL) ? "ctx->Pixel, " : "",
49 (state & _NEW_POINT) ? "ctx->Point, " : "",
50 (state & _NEW_POLYGON) ? "ctx->Polygon, " : "",
51 (state & _NEW_POLYGONSTIPPLE) ? "ctx->PolygonStipple, " : "",
52 (state & _NEW_SCISSOR) ? "ctx->Scissor, " : "",
53 (state & _NEW_TEXTURE) ? "ctx->Texture, " : "",
54 (state & _NEW_TRANSFORM) ? "ctx->Transform, " : "",
55 (state & _NEW_VIEWPORT) ? "ctx->Viewport, " : "",
56 (state & _NEW_PACKUNPACK) ? "ctx->Pack/Unpack, " : "",
57 (state & _NEW_ARRAY) ? "ctx->Array, " : "",
58 (state & _NEW_RENDERMODE) ? "ctx->RenderMode, " : "",
59 (state & _NEW_BUFFERS) ? "ctx->Visual, ctx->DrawBuffer,, " : "");
60 }
61
62
63 void _mesa_print_enable_flags( const char *msg, GLuint flags )
64 {
65 fprintf(stderr,
66 "%s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
67 msg,
68 flags,
69 (flags & ENABLE_LIGHT) ? "light, " : "",
70 (flags & ENABLE_FOG) ? "fog, " : "",
71 (flags & ENABLE_USERCLIP) ? "userclip, " : "",
72 (flags & ENABLE_TEXGEN0) ? "tex-gen-0, " : "",
73 (flags & ENABLE_TEXGEN1) ? "tex-gen-1, " : "",
74 (flags & ENABLE_TEXGEN2) ? "tex-gen-2, " : "",
75 (flags & ENABLE_TEXGEN3) ? "tex-gen-3, " : "",
76 (flags & ENABLE_TEXGEN4) ? "tex-gen-4, " : "",
77 (flags & ENABLE_TEXGEN5) ? "tex-gen-5, " : "",
78 (flags & ENABLE_TEXGEN6) ? "tex-gen-6, " : "",
79 (flags & ENABLE_TEXGEN7) ? "tex-gen-7, " : "",
80 (flags & ENABLE_TEXMAT0) ? "tex-mat-0, " : "",
81 (flags & ENABLE_TEXMAT1) ? "tex-mat-1, " : "",
82 (flags & ENABLE_TEXMAT2) ? "tex-mat-2, " : "",
83 (flags & ENABLE_TEXMAT3) ? "tex-mat-3, " : "",
84 (flags & ENABLE_TEXMAT4) ? "tex-mat-4, " : "",
85 (flags & ENABLE_TEXMAT5) ? "tex-mat-5, " : "",
86 (flags & ENABLE_TEXMAT6) ? "tex-mat-6, " : "",
87 (flags & ENABLE_TEXMAT7) ? "tex-mat-7, " : "",
88 (flags & ENABLE_NORMALIZE) ? "normalize, " : "",
89 (flags & ENABLE_RESCALE) ? "rescale, " : "");
90 }
91
92 void _mesa_print_tri_caps( const char *name, GLuint flags )
93 {
94 fprintf(stderr,
95 "%s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
96 name,
97 flags,
98 (flags & DD_FEEDBACK) ? "feedback, " : "",
99 (flags & DD_SELECT) ? "select, " : "",
100 (flags & DD_FLATSHADE) ? "flat-shade, " : "",
101 (flags & DD_SEPARATE_SPECULAR) ? "separate-specular, " : "",
102 (flags & DD_TRI_LIGHT_TWOSIDE) ? "tri-light-twoside, " : "",
103 (flags & DD_TRI_UNFILLED) ? "tri-unfilled, " : "",
104 (flags & DD_TRI_STIPPLE) ? "tri-stipple, " : "",
105 (flags & DD_TRI_OFFSET) ? "tri-offset, " : "",
106 (flags & DD_TRI_SMOOTH) ? "tri-smooth, " : "",
107 (flags & DD_LINE_SMOOTH) ? "line-smooth, " : "",
108 (flags & DD_LINE_STIPPLE) ? "line-stipple, " : "",
109 (flags & DD_LINE_WIDTH) ? "line-wide, " : "",
110 (flags & DD_POINT_SMOOTH) ? "point-smooth, " : "",
111 (flags & DD_POINT_SIZE) ? "point-size, " : "",
112 (flags & DD_POINT_ATTEN) ? "point-atten, " : "",
113 (flags & DD_TRI_CULL_FRONT_BACK) ? "cull-all, " : "",
114 (flags & DD_STENCIL) ? "stencil, " : ""
115 );
116 }