Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygent_dd_unfilled.h
Go to the documentation of this file.
00001 /* 00002 * Mesa 3-D graphics library 00003 * Version: 6.5.1 00004 * 00005 * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. 00006 * 00007 * Permission is hereby granted, free of charge, to any person obtaining a 00008 * copy of this software and associated documentation files (the "Software"), 00009 * to deal in the Software without restriction, including without limitation 00010 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 00011 * and/or sell copies of the Software, and to permit persons to whom the 00012 * Software is furnished to do so, subject to the following conditions: 00013 * 00014 * The above copyright notice and this permission notice shall be included 00015 * in all copies or substantial portions of the Software. 00016 * 00017 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 00018 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 00019 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 00020 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 00021 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 00022 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 00023 * 00024 * Authors: 00025 * Keith Whitwell <keith@tungstengraphics.com> 00026 */ 00027 00028 #if HAVE_RGBA 00029 #define VERT_SET_IND( v, c ) 00030 #define VERT_COPY_IND( v0, v1 ) 00031 #define VERT_SAVE_IND( idx ) 00032 #define VERT_RESTORE_IND( idx ) 00033 #endif 00034 00035 #if !HAVE_SPEC 00036 #define VERT_SET_SPEC( v, c ) 00037 #define VERT_COPY_SPEC( v0, v1 ) 00038 #define VERT_SAVE_SPEC( idx ) 00039 #define VERT_RESTORE_SPEC( idx ) 00040 #endif 00041 00042 static void TAG(unfilled_tri)( GLcontext *ctx, 00043 GLenum mode, 00044 GLuint e0, GLuint e1, GLuint e2 ) 00045 { 00046 struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; 00047 GLubyte *ef = VB->EdgeFlag; 00048 VERTEX *v[3]; 00049 LOCAL_VARS(3); 00050 00051 v[0] = (VERTEX *)GET_VERTEX(e0); 00052 v[1] = (VERTEX *)GET_VERTEX(e1); 00053 v[2] = (VERTEX *)GET_VERTEX(e2); 00054 00055 if (ctx->Light.ShadeModel == GL_FLAT && HAVE_HW_FLATSHADE) { 00056 if (HAVE_RGBA) { 00057 VERT_SAVE_RGBA(0); 00058 VERT_SAVE_RGBA(1); 00059 VERT_COPY_RGBA(v[0], v[2]); 00060 VERT_COPY_RGBA(v[1], v[2]); 00061 00062 if (HAVE_SPEC) { 00063 VERT_SAVE_SPEC(0); 00064 VERT_SAVE_SPEC(1); 00065 VERT_COPY_SPEC(v[0], v[2]); 00066 VERT_COPY_SPEC(v[1], v[2]); 00067 } 00068 } else { 00069 VERT_SAVE_IND(0); 00070 VERT_SAVE_IND(1); 00071 VERT_COPY_IND(v[0], v[2]); 00072 VERT_COPY_IND(v[1], v[2]); 00073 } 00074 } 00075 00076 /* fprintf(stderr, "%s %s %d %d %d\n", __FUNCTION__, */ 00077 /* _mesa_lookup_enum_by_nr( mode ), */ 00078 /* ef[e0], ef[e1], ef[e2]); */ 00079 00080 if (mode == GL_POINT) { 00081 RASTERIZE(GL_POINTS); 00082 if (ef[e0]) POINT( v[0] ); 00083 if (ef[e1]) POINT( v[1] ); 00084 if (ef[e2]) POINT( v[2] ); 00085 } 00086 else { 00087 RASTERIZE(GL_LINES); 00088 if (RENDER_PRIMITIVE == GL_POLYGON) { 00089 if (ef[e2]) LINE( v[2], v[0] ); 00090 if (ef[e0]) LINE( v[0], v[1] ); 00091 if (ef[e1]) LINE( v[1], v[2] ); 00092 } 00093 else { 00094 if (ef[e0]) LINE( v[0], v[1] ); 00095 if (ef[e1]) LINE( v[1], v[2] ); 00096 if (ef[e2]) LINE( v[2], v[0] ); 00097 } 00098 } 00099 00100 if (ctx->Light.ShadeModel == GL_FLAT && HAVE_HW_FLATSHADE) { 00101 if (HAVE_RGBA) { 00102 VERT_RESTORE_RGBA(0); 00103 VERT_RESTORE_RGBA(1); 00104 00105 if (HAVE_SPEC) { 00106 VERT_RESTORE_SPEC(0); 00107 VERT_RESTORE_SPEC(1); 00108 } 00109 } else { 00110 VERT_RESTORE_IND(0); 00111 VERT_RESTORE_IND(1); 00112 } 00113 } 00114 } 00115 00116 00117 static void TAG(unfilled_quad)( GLcontext *ctx, 00118 GLenum mode, 00119 GLuint e0, GLuint e1, 00120 GLuint e2, GLuint e3 ) 00121 { 00122 struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; 00123 GLubyte *ef = VB->EdgeFlag; 00124 VERTEX *v[4]; 00125 LOCAL_VARS(4); 00126 00127 v[0] = (VERTEX *)GET_VERTEX(e0); 00128 v[1] = (VERTEX *)GET_VERTEX(e1); 00129 v[2] = (VERTEX *)GET_VERTEX(e2); 00130 v[3] = (VERTEX *)GET_VERTEX(e3); 00131 00132 /* Hardware flatshading breaks down here. If the hardware doesn't 00133 * support flatshading, this will already have been done: 00134 */ 00135 if (ctx->Light.ShadeModel == GL_FLAT && HAVE_HW_FLATSHADE) { 00136 if (HAVE_RGBA) { 00137 VERT_SAVE_RGBA(0); 00138 VERT_SAVE_RGBA(1); 00139 VERT_SAVE_RGBA(2); 00140 VERT_COPY_RGBA(v[0], v[3]); 00141 VERT_COPY_RGBA(v[1], v[3]); 00142 VERT_COPY_RGBA(v[2], v[3]); 00143 00144 if (HAVE_SPEC) { 00145 VERT_SAVE_SPEC(0); 00146 VERT_SAVE_SPEC(1); 00147 VERT_SAVE_SPEC(2); 00148 VERT_COPY_SPEC(v[0], v[3]); 00149 VERT_COPY_SPEC(v[1], v[3]); 00150 VERT_COPY_SPEC(v[2], v[3]); 00151 } 00152 } else { 00153 VERT_SAVE_IND(0); 00154 VERT_SAVE_IND(1); 00155 VERT_SAVE_IND(2); 00156 VERT_COPY_IND(v[0], v[3]); 00157 VERT_COPY_IND(v[1], v[3]); 00158 VERT_COPY_IND(v[2], v[3]); 00159 } 00160 } 00161 00162 if (mode == GL_POINT) { 00163 RASTERIZE(GL_POINTS); 00164 if (ef[e0]) POINT( v[0] ); 00165 if (ef[e1]) POINT( v[1] ); 00166 if (ef[e2]) POINT( v[2] ); 00167 if (ef[e3]) POINT( v[3] ); 00168 } 00169 else { 00170 RASTERIZE(GL_LINES); 00171 if (ef[e0]) LINE( v[0], v[1] ); 00172 if (ef[e1]) LINE( v[1], v[2] ); 00173 if (ef[e2]) LINE( v[2], v[3] ); 00174 if (ef[e3]) LINE( v[3], v[0] ); 00175 } 00176 00177 if (ctx->Light.ShadeModel == GL_FLAT && HAVE_HW_FLATSHADE) { 00178 if (HAVE_RGBA) { 00179 VERT_RESTORE_RGBA(0); 00180 VERT_RESTORE_RGBA(1); 00181 VERT_RESTORE_RGBA(2); 00182 00183 if (HAVE_SPEC) { 00184 VERT_RESTORE_SPEC(0); 00185 VERT_RESTORE_SPEC(1); 00186 VERT_RESTORE_SPEC(2); 00187 } 00188 } else { 00189 VERT_RESTORE_IND(0); 00190 VERT_RESTORE_IND(1); 00191 VERT_RESTORE_IND(2); 00192 } 00193 } 00194 } 00195 00196 00197 #if HAVE_RGBA 00198 #undef VERT_SET_IND 00199 #undef VERT_COPY_IND 00200 #undef VERT_SAVE_IND 00201 #undef VERT_RESTORE_IND 00202 #endif 00203 00204 #if !HAVE_SPEC 00205 #undef VERT_SET_SPEC 00206 #undef VERT_COPY_SPEC 00207 #undef VERT_SAVE_SPEC 00208 #undef VERT_RESTORE_SPEC 00209 #endif 00210 00211 #undef TAG Generated on Fri May 25 2012 04:18:56 for ReactOS by
1.7.6.1
|