summaryrefslogtreecommitdiff
path: root/xc/extras/Mesa/src/hint.c
diff options
context:
space:
mode:
authorbrianp <brianp>2000-03-23 19:09:33 +0000
committerbrianp <brianp>2000-03-23 19:09:33 +0000
commit5d5675f9be9673ef87677d76dda4177a3409b9fb (patch)
tree1557d13612f15bae26f283698fbf2e2806f0f7df /xc/extras/Mesa/src/hint.c
parentbc33e81510fdc10118c1224db95a980a30b7b057 (diff)
Mesa 3.3 update
Variable size depth buffers New device driver texture image interface GL_EXT_texture_lod_bias extension
Diffstat (limited to 'xc/extras/Mesa/src/hint.c')
-rw-r--r--xc/extras/Mesa/src/hint.c151
1 files changed, 81 insertions, 70 deletions
diff --git a/xc/extras/Mesa/src/hint.c b/xc/extras/Mesa/src/hint.c
index 210138d2b..2d7427f01 100644
--- a/xc/extras/Mesa/src/hint.c
+++ b/xc/extras/Mesa/src/hint.c
@@ -52,78 +52,84 @@ _mesa_try_Hint( GLcontext *ctx, GLenum target, GLenum mode )
if (MESA_VERBOSE & VERBOSE_API)
fprintf(stderr, "glHint %s %d\n", gl_lookup_enum_by_nr(target), mode);
- switch (target) {
- case GL_FOG_HINT:
- ctx->Hint.Fog = mode;
- break;
- case GL_LINE_SMOOTH_HINT:
- ctx->Hint.LineSmooth = mode;
- break;
- case GL_PERSPECTIVE_CORRECTION_HINT:
- ctx->Hint.PerspectiveCorrection = mode;
- break;
- case GL_POINT_SMOOTH_HINT:
- ctx->Hint.PointSmooth = mode;
- break;
- case GL_POLYGON_SMOOTH_HINT:
- ctx->Hint.PolygonSmooth = mode;
- break;
- case GL_PREFER_DOUBLEBUFFER_HINT_PGI:
- case GL_STRICT_DEPTHFUNC_HINT_PGI:
- break;
- case GL_STRICT_LIGHTING_HINT_PGI:
- ctx->Hint.StrictLighting = mode;
- break;
- case GL_STRICT_SCISSOR_HINT_PGI:
- case GL_FULL_STIPPLE_HINT_PGI:
- case GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI:
- case GL_NATIVE_GRAPHICS_END_HINT_PGI:
- case GL_CONSERVE_MEMORY_HINT_PGI:
- case GL_RECLAIM_MEMORY_HINT_PGI:
- break;
- case GL_ALWAYS_FAST_HINT_PGI:
- if (mode) {
- ctx->Hint.AllowDrawWin = GL_TRUE;
- ctx->Hint.AllowDrawSpn = GL_FALSE;
- ctx->Hint.AllowDrawMem = GL_FALSE;
- } else {
- ctx->Hint.AllowDrawWin = GL_TRUE;
- ctx->Hint.AllowDrawSpn = GL_TRUE;
- ctx->Hint.AllowDrawMem = GL_TRUE;
- }
- break;
- case GL_ALWAYS_SOFT_HINT_PGI:
- ctx->Hint.AllowDrawWin = GL_TRUE;
- ctx->Hint.AllowDrawSpn = GL_TRUE;
- ctx->Hint.AllowDrawMem = GL_TRUE;
- break;
- case GL_ALLOW_DRAW_OBJ_HINT_PGI:
- break;
- case GL_ALLOW_DRAW_WIN_HINT_PGI:
- ctx->Hint.AllowDrawWin = mode;
- break;
- case GL_ALLOW_DRAW_SPN_HINT_PGI:
- ctx->Hint.AllowDrawSpn = mode;
- break;
- case GL_ALLOW_DRAW_MEM_HINT_PGI:
- ctx->Hint.AllowDrawMem = mode;
- break;
- case GL_CLIP_NEAR_HINT_PGI:
- case GL_CLIP_FAR_HINT_PGI:
- case GL_WIDE_LINE_HINT_PGI:
- case GL_BACK_NORMALS_HINT_PGI:
- case GL_NATIVE_GRAPHICS_HANDLE_PGI:
- break;
-
- /* GL_EXT_clip_volume_hint */
- case GL_CLIP_VOLUME_CLIPPING_HINT_EXT:
- ctx->Hint.ClipVolumeClipping = mode;
- break;
-
- default:
- gl_error( ctx, GL_INVALID_ENUM, "glHint(target)" );
+ if (mode != GL_NICEST && mode != GL_FASTEST && mode != GL_DONT_CARE) {
+ gl_error(ctx, GL_INVALID_ENUM, "glHint(mode)");
return GL_FALSE;
}
+
+ switch (target) {
+ case GL_FOG_HINT:
+ ctx->Hint.Fog = mode;
+ break;
+ case GL_LINE_SMOOTH_HINT:
+ ctx->Hint.LineSmooth = mode;
+ break;
+ case GL_PERSPECTIVE_CORRECTION_HINT:
+ ctx->Hint.PerspectiveCorrection = mode;
+ break;
+ case GL_POINT_SMOOTH_HINT:
+ ctx->Hint.PointSmooth = mode;
+ break;
+ case GL_POLYGON_SMOOTH_HINT:
+ ctx->Hint.PolygonSmooth = mode;
+ break;
+ case GL_PREFER_DOUBLEBUFFER_HINT_PGI:
+ case GL_STRICT_DEPTHFUNC_HINT_PGI:
+ break;
+ case GL_STRICT_LIGHTING_HINT_PGI:
+ ctx->Hint.StrictLighting = mode;
+ break;
+ case GL_STRICT_SCISSOR_HINT_PGI:
+ case GL_FULL_STIPPLE_HINT_PGI:
+ case GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI:
+ case GL_NATIVE_GRAPHICS_END_HINT_PGI:
+ case GL_CONSERVE_MEMORY_HINT_PGI:
+ case GL_RECLAIM_MEMORY_HINT_PGI:
+ break;
+ case GL_ALWAYS_FAST_HINT_PGI:
+ if (mode) {
+ ctx->Hint.AllowDrawWin = GL_TRUE;
+ ctx->Hint.AllowDrawSpn = GL_FALSE;
+ ctx->Hint.AllowDrawMem = GL_FALSE;
+ } else {
+ ctx->Hint.AllowDrawWin = GL_TRUE;
+ ctx->Hint.AllowDrawSpn = GL_TRUE;
+ ctx->Hint.AllowDrawMem = GL_TRUE;
+ }
+ break;
+ case GL_ALWAYS_SOFT_HINT_PGI:
+ ctx->Hint.AllowDrawWin = GL_TRUE;
+ ctx->Hint.AllowDrawSpn = GL_TRUE;
+ ctx->Hint.AllowDrawMem = GL_TRUE;
+ break;
+ case GL_ALLOW_DRAW_OBJ_HINT_PGI:
+ break;
+ case GL_ALLOW_DRAW_WIN_HINT_PGI:
+ ctx->Hint.AllowDrawWin = mode;
+ break;
+ case GL_ALLOW_DRAW_SPN_HINT_PGI:
+ ctx->Hint.AllowDrawSpn = mode;
+ break;
+ case GL_ALLOW_DRAW_MEM_HINT_PGI:
+ ctx->Hint.AllowDrawMem = mode;
+ break;
+ case GL_CLIP_NEAR_HINT_PGI:
+ case GL_CLIP_FAR_HINT_PGI:
+ case GL_WIDE_LINE_HINT_PGI:
+ case GL_BACK_NORMALS_HINT_PGI:
+ case GL_NATIVE_GRAPHICS_HANDLE_PGI:
+ break;
+
+ /* GL_EXT_clip_volume_hint */
+ case GL_CLIP_VOLUME_CLIPPING_HINT_EXT:
+ ctx->Hint.ClipVolumeClipping = mode;
+ break;
+
+ default:
+ gl_error( ctx, GL_INVALID_ENUM, "glHint(target)" );
+ return GL_FALSE;
+ }
+
ctx->NewState |= NEW_ALL; /* just to be safe */
if (ctx->Driver.Hint) {
@@ -143,6 +149,11 @@ _mesa_HintPGI( GLenum target, GLint mode )
if (MESA_VERBOSE & VERBOSE_API)
fprintf(stderr, "glHintPGI %s %d\n", gl_lookup_enum_by_nr(target), mode);
+ if (mode != GL_NICEST && mode != GL_FASTEST && mode != GL_DONT_CARE) {
+ gl_error(ctx, GL_INVALID_ENUM, "glHintPGI(mode)");
+ return;
+ }
+
switch (target) {
case GL_PREFER_DOUBLEBUFFER_HINT_PGI:
case GL_STRICT_DEPTHFUNC_HINT_PGI: