Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenhint.c
Go to the documentation of this file.
00001 00002 /* 00003 * Mesa 3-D graphics library 00004 * Version: 4.1 00005 * 00006 * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. 00007 * 00008 * Permission is hereby granted, free of charge, to any person obtaining a 00009 * copy of this software and associated documentation files (the "Software"), 00010 * to deal in the Software without restriction, including without limitation 00011 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 00012 * and/or sell copies of the Software, and to permit persons to whom the 00013 * Software is furnished to do so, subject to the following conditions: 00014 * 00015 * The above copyright notice and this permission notice shall be included 00016 * in all copies or substantial portions of the Software. 00017 * 00018 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 00019 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 00020 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 00021 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 00022 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 00023 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 00024 */ 00025 00026 00027 #include "glheader.h" 00028 #include "enums.h" 00029 #include "context.h" 00030 #include "hint.h" 00031 #include "imports.h" 00032 00033 00034 00035 void GLAPIENTRY 00036 _mesa_Hint( GLenum target, GLenum mode ) 00037 { 00038 GET_CURRENT_CONTEXT(ctx); 00039 ASSERT_OUTSIDE_BEGIN_END(ctx); 00040 00041 if (MESA_VERBOSE & VERBOSE_API) 00042 _mesa_debug(ctx, "glHint %s %d\n", 00043 _mesa_lookup_enum_by_nr(target), mode); 00044 00045 if (mode != GL_NICEST && mode != GL_FASTEST && mode != GL_DONT_CARE) { 00046 _mesa_error(ctx, GL_INVALID_ENUM, "glHint(mode)"); 00047 return; 00048 } 00049 00050 switch (target) { 00051 case GL_FOG_HINT: 00052 if (ctx->Hint.Fog == mode) 00053 return; 00054 FLUSH_VERTICES(ctx, _NEW_HINT); 00055 ctx->Hint.Fog = mode; 00056 break; 00057 case GL_LINE_SMOOTH_HINT: 00058 if (ctx->Hint.LineSmooth == mode) 00059 return; 00060 FLUSH_VERTICES(ctx, _NEW_HINT); 00061 ctx->Hint.LineSmooth = mode; 00062 break; 00063 case GL_PERSPECTIVE_CORRECTION_HINT: 00064 if (ctx->Hint.PerspectiveCorrection == mode) 00065 return; 00066 FLUSH_VERTICES(ctx, _NEW_HINT); 00067 ctx->Hint.PerspectiveCorrection = mode; 00068 break; 00069 case GL_POINT_SMOOTH_HINT: 00070 if (ctx->Hint.PointSmooth == mode) 00071 return; 00072 FLUSH_VERTICES(ctx, _NEW_HINT); 00073 ctx->Hint.PointSmooth = mode; 00074 break; 00075 case GL_POLYGON_SMOOTH_HINT: 00076 if (ctx->Hint.PolygonSmooth == mode) 00077 return; 00078 FLUSH_VERTICES(ctx, _NEW_HINT); 00079 ctx->Hint.PolygonSmooth = mode; 00080 break; 00081 00082 /* GL_EXT_clip_volume_hint */ 00083 case GL_CLIP_VOLUME_CLIPPING_HINT_EXT: 00084 if (ctx->Hint.ClipVolumeClipping == mode) 00085 return; 00086 FLUSH_VERTICES(ctx, _NEW_HINT); 00087 ctx->Hint.ClipVolumeClipping = mode; 00088 break; 00089 00090 /* GL_ARB_texture_compression */ 00091 case GL_TEXTURE_COMPRESSION_HINT_ARB: 00092 if (!ctx->Extensions.ARB_texture_compression) { 00093 _mesa_error(ctx, GL_INVALID_ENUM, "glHint(target)"); 00094 return; 00095 } 00096 if (ctx->Hint.TextureCompression == mode) 00097 return; 00098 FLUSH_VERTICES(ctx, _NEW_HINT); 00099 ctx->Hint.TextureCompression = mode; 00100 break; 00101 00102 /* GL_SGIS_generate_mipmap */ 00103 case GL_GENERATE_MIPMAP_HINT_SGIS: 00104 if (!ctx->Extensions.SGIS_generate_mipmap) { 00105 _mesa_error(ctx, GL_INVALID_ENUM, "glHint(target)"); 00106 return; 00107 } 00108 if (ctx->Hint.GenerateMipmap == mode) 00109 return; 00110 FLUSH_VERTICES(ctx, _NEW_HINT); 00111 ctx->Hint.GenerateMipmap = mode; 00112 break; 00113 00114 /* GL_ARB_fragment_shader */ 00115 case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB: 00116 if (!ctx->Extensions.ARB_fragment_shader) { 00117 _mesa_error(ctx, GL_INVALID_ENUM, "glHint(target)"); 00118 return; 00119 } 00120 if (ctx->Hint.FragmentShaderDerivative == mode) 00121 return; 00122 FLUSH_VERTICES(ctx, _NEW_HINT); 00123 ctx->Hint.FragmentShaderDerivative = mode; 00124 break; 00125 00126 default: 00127 _mesa_error(ctx, GL_INVALID_ENUM, "glHint(target)"); 00128 return; 00129 } 00130 00131 if (ctx->Driver.Hint) { 00132 (*ctx->Driver.Hint)( ctx, target, mode ); 00133 } 00134 } 00135 00136 00137 /**********************************************************************/ 00138 /***** Initialization *****/ 00139 /**********************************************************************/ 00140 00141 void _mesa_init_hint( GLcontext * ctx ) 00142 { 00143 /* Hint group */ 00144 ctx->Hint.PerspectiveCorrection = GL_DONT_CARE; 00145 ctx->Hint.PointSmooth = GL_DONT_CARE; 00146 ctx->Hint.LineSmooth = GL_DONT_CARE; 00147 ctx->Hint.PolygonSmooth = GL_DONT_CARE; 00148 ctx->Hint.Fog = GL_DONT_CARE; 00149 ctx->Hint.ClipVolumeClipping = GL_DONT_CARE; 00150 ctx->Hint.TextureCompression = GL_DONT_CARE; 00151 ctx->Hint.GenerateMipmap = GL_DONT_CARE; 00152 ctx->Hint.FragmentShaderDerivative = GL_DONT_CARE; 00153 } Generated on Sun May 27 2012 04:20:18 for ReactOS by
1.7.6.1
|