1 /* $Id: debug.c,v 1.11 2001/03/29 17:08:26 keithw Exp $ */
4 * Mesa 3-D graphics library
7 * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
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:
16 * The above copyright notice and this permission notice shall be included
17 * in all copies or substantial portions of the Software.
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.
30 void _mesa_print_state( const char *msg
, GLuint state
)
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\n",
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,, " : "");
63 void _mesa_print_enable_flags( const char *msg
, GLuint flags
)
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",
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, " : "");
92 void _mesa_print_tri_caps( const char *name
, GLuint flags
)
95 "%s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
98 (flags
& DD_FLATSHADE
) ? "flat-shade, " : "",
99 (flags
& DD_SEPARATE_SPECULAR
) ? "separate-specular, " : "",
100 (flags
& DD_TRI_LIGHT_TWOSIDE
) ? "tri-light-twoside, " : "",
101 (flags
& DD_TRI_UNFILLED
) ? "tri-unfilled, " : "",
102 (flags
& DD_TRI_STIPPLE
) ? "tri-stipple, " : "",
103 (flags
& DD_TRI_OFFSET
) ? "tri-offset, " : "",
104 (flags
& DD_TRI_SMOOTH
) ? "tri-smooth, " : "",
105 (flags
& DD_LINE_SMOOTH
) ? "line-smooth, " : "",
106 (flags
& DD_LINE_STIPPLE
) ? "line-stipple, " : "",
107 (flags
& DD_LINE_WIDTH
) ? "line-wide, " : "",
108 (flags
& DD_POINT_SMOOTH
) ? "point-smooth, " : "",
109 (flags
& DD_POINT_SIZE
) ? "point-size, " : "",
110 (flags
& DD_POINT_ATTEN
) ? "point-atten, " : "",
111 (flags
& DD_TRI_CULL_FRONT_BACK
) ? "cull-all, " : ""