Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygens_context.h
Go to the documentation of this file.
00001 /* 00002 * Mesa 3-D graphics library 00003 * Version: 6.5.3 00004 * 00005 * Copyright (C) 1999-2007 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 00025 00043 #ifndef S_CONTEXT_H 00044 #define S_CONTEXT_H 00045 00046 #include "main/mtypes.h" 00047 #include "shader/prog_execute.h" 00048 #include "swrast.h" 00049 #include "s_span.h" 00050 00051 00052 typedef void (*texture_sample_func)(GLcontext *ctx, 00053 const struct gl_texture_object *tObj, 00054 GLuint n, const GLfloat texcoords[][4], 00055 const GLfloat lambda[], GLchan rgba[][4]); 00056 00057 typedef void (_ASMAPIP blend_func)( GLcontext *ctx, GLuint n, 00058 const GLubyte mask[], 00059 GLvoid *src, const GLvoid *dst, 00060 GLenum chanType); 00061 00062 typedef void (*swrast_point_func)( GLcontext *ctx, const SWvertex *); 00063 00064 typedef void (*swrast_line_func)( GLcontext *ctx, 00065 const SWvertex *, const SWvertex *); 00066 00067 typedef void (*swrast_tri_func)( GLcontext *ctx, const SWvertex *, 00068 const SWvertex *, const SWvertex *); 00069 00070 00071 typedef void (*validate_texture_image_func)(GLcontext *ctx, 00072 struct gl_texture_object *texObj, 00073 GLuint face, GLuint level); 00074 00075 00082 #define ALPHATEST_BIT 0x001 00083 #define BLEND_BIT 0x002 00084 #define DEPTH_BIT 0x004 00085 #define FOG_BIT 0x008 00086 #define LOGIC_OP_BIT 0x010 00087 #define CLIP_BIT 0x020 00088 #define STENCIL_BIT 0x040 00089 #define MASKING_BIT 0x080 00090 #define MULTI_DRAW_BIT 0x400 00092 #define OCCLUSION_BIT 0x800 00093 #define TEXTURE_BIT 0x1000 00094 #define FRAGPROG_BIT 0x2000 00095 #define ATIFRAGSHADER_BIT 0x4000 00096 #define CLAMPING_BIT 0x8000 00098 00099 #define _SWRAST_NEW_RASTERMASK (_NEW_BUFFERS| \ 00100 _NEW_SCISSOR| \ 00101 _NEW_COLOR| \ 00102 _NEW_DEPTH| \ 00103 _NEW_FOG| \ 00104 _NEW_PROGRAM| \ 00105 _NEW_STENCIL| \ 00106 _NEW_TEXTURE| \ 00107 _NEW_VIEWPORT| \ 00108 _NEW_DEPTH) 00109 00110 00115 typedef struct 00116 { 00119 struct swrast_device_driver Driver; 00120 00124 GLboolean AllowVertexFog; 00125 GLboolean AllowPixelFog; 00126 00130 GLbitfield _RasterMask; 00131 GLfloat _BackfaceSign; 00132 GLfloat _BackfaceCullSign; 00133 GLboolean _PreferPixelFog; /* Compute fog blend factor per fragment? */ 00134 GLboolean _AnyTextureCombine; 00135 GLboolean _FogEnabled; 00136 GLboolean _DeferredTexture; 00137 GLenum _FogMode; /* either GL_FOG_MODE or fragment program's fog mode */ 00138 00140 GLuint _ActiveAttribs[FRAG_ATTRIB_MAX]; 00142 GLbitfield _ActiveAttribMask; 00144 GLuint _NumActiveAttribs; 00146 GLenum _InterpMode[FRAG_ATTRIB_MAX]; /* GL_FLAT or GL_SMOOTH (for now) */ 00147 00148 /* Accum buffer temporaries. 00149 */ 00150 GLboolean _IntegerAccumMode; 00151 GLfloat _IntegerAccumScaler; 00153 /* Working values: 00154 */ 00155 GLuint StippleCounter; 00156 GLuint PointLineFacing; 00157 GLbitfield NewState; 00158 GLuint StateChanges; 00159 GLenum Primitive; /* current primitive being drawn (ala glBegin) */ 00160 00161 void (*InvalidateState)( GLcontext *ctx, GLbitfield new_state ); 00162 00168 GLbitfield InvalidatePointMask; 00169 GLbitfield InvalidateLineMask; 00170 GLbitfield InvalidateTriangleMask; 00178 void (*choose_point)( GLcontext * ); 00179 void (*choose_line)( GLcontext * ); 00180 void (*choose_triangle)( GLcontext * ); 00187 swrast_point_func Point; 00188 swrast_line_func Line; 00189 swrast_tri_func Triangle; 00197 swrast_point_func SpecPoint; 00198 swrast_line_func SpecLine; 00199 swrast_tri_func SpecTriangle; 00208 SWspanarrays *SpanArrays; 00209 SWspanarrays *ZoomedArrays; 00214 SWspan PointSpan; 00215 00218 blend_func BlendFunc; 00219 texture_sample_func TextureSample[MAX_TEXTURE_IMAGE_UNITS]; 00220 00224 GLchan *TexelBuffer; 00225 00226 validate_texture_image_func ValidateTextureImage; 00227 00229 struct gl_program_machine FragProgMachine; 00230 00231 } SWcontext; 00232 00233 00234 extern void 00235 _swrast_validate_derived( GLcontext *ctx ); 00236 00237 extern void 00238 _swrast_update_texture_samplers(GLcontext *ctx); 00239 00240 00241 #define SWRAST_CONTEXT(ctx) ((SWcontext *)ctx->swrast_context) 00242 00243 #define RENDER_START(SWctx, GLctx) \ 00244 do { \ 00245 if ((SWctx)->Driver.SpanRenderStart) { \ 00246 (*(SWctx)->Driver.SpanRenderStart)(GLctx); \ 00247 } \ 00248 } while (0) 00249 00250 #define RENDER_FINISH(SWctx, GLctx) \ 00251 do { \ 00252 if ((SWctx)->Driver.SpanRenderFinish) { \ 00253 (*(SWctx)->Driver.SpanRenderFinish)(GLctx); \ 00254 } \ 00255 } while (0) 00256 00257 00258 00262 #define RGBA_PIXEL_SIZE(TYPE) \ 00263 ((TYPE == GL_UNSIGNED_BYTE) ? 4 * sizeof(GLubyte) : \ 00264 ((TYPE == GL_UNSIGNED_SHORT) ? 4 * sizeof(GLushort) \ 00265 : 4 * sizeof(GLfloat))) 00266 00267 00268 00269 /* 00270 * XXX these macros are just bandages for now in order to make 00271 * CHAN_BITS==32 compile cleanly. 00272 * These should probably go elsewhere at some point. 00273 */ 00274 #if CHAN_TYPE == GL_FLOAT 00275 #define ChanToFixed(X) (X) 00276 #define FixedToChan(X) (X) 00277 #else 00278 #define ChanToFixed(X) IntToFixed(X) 00279 #define FixedToChan(X) FixedToInt(X) 00280 #endif 00281 00282 00287 #define ATTRIB_LOOP_BEGIN \ 00288 { \ 00289 GLuint a; \ 00290 for (a = 0; a < swrast->_NumActiveAttribs; a++) { \ 00291 const GLuint attr = swrast->_ActiveAttribs[a]; 00292 00293 #define ATTRIB_LOOP_END } } 00294 00295 00296 00297 #endif Generated on Sun May 27 2012 04:20:42 for ReactOS by
1.7.6.1
|