summaryrefslogtreecommitdiff
path: root/src/mesa/main/fog.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>1999-11-11 01:22:25 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>1999-11-11 01:22:25 +0000
commitfbd8f212c3866ec98c1d8c9d3db3ddb7e7c479a5 (patch)
treefb9ea4452e1f65c6e3c11ee4c4f17c023f8262e5 /src/mesa/main/fog.c
parent06ac59281bdad6679fb1941e31e3c4df1c12cede (diff)
first big check-in of new Mesa 3.3 code
Diffstat (limited to 'src/mesa/main/fog.c')
-rw-r--r--src/mesa/main/fog.c58
1 files changed, 47 insertions, 11 deletions
diff --git a/src/mesa/main/fog.c b/src/mesa/main/fog.c
index 211454b112..e1a69f3b0d 100644
--- a/src/mesa/main/fog.c
+++ b/src/mesa/main/fog.c
@@ -1,8 +1,8 @@
-/* $Id: fog.c,v 1.3 1999/11/08 07:36:44 brianp Exp $ */
+/* $Id: fog.c,v 1.4 1999/11/11 01:22:26 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,17 +25,10 @@
*/
-/* $XFree86: xc/lib/GL/mesa/src/fog.c,v 1.4 1999/04/04 00:20:24 dawes Exp $ */
-
#ifdef PC_HEADER
#include "all.h"
#else
-#ifndef XFree86Server
-#include <math.h>
-#include <stdlib.h>
-#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "context.h"
#include "fog.h"
#include "macros.h"
@@ -45,8 +38,51 @@
-void gl_Fogfv( GLcontext *ctx, GLenum pname, const GLfloat *params )
+void
+_mesa_Fogf(GLenum pname, GLfloat param)
+{
+ _mesa_Fogfv(pname, &param);
+}
+
+
+void
+_mesa_Fogi(GLenum pname, GLint param )
+{
+ GLfloat fparam = (GLfloat) param;
+ _mesa_Fogfv(pname, &fparam);
+}
+
+
+void
+_mesa_Fogiv(GLenum pname, const GLint *params )
+{
+ GLfloat p[4];
+ switch (pname) {
+ case GL_FOG_MODE:
+ case GL_FOG_DENSITY:
+ case GL_FOG_START:
+ case GL_FOG_END:
+ case GL_FOG_INDEX:
+ p[0] = (GLfloat) *params;
+ break;
+ case GL_FOG_COLOR:
+ p[0] = INT_TO_FLOAT( params[0] );
+ p[1] = INT_TO_FLOAT( params[1] );
+ p[2] = INT_TO_FLOAT( params[2] );
+ p[3] = INT_TO_FLOAT( params[3] );
+ break;
+ default:
+ /* Error will be caught later in gl_Fogfv */
+ ;
+ }
+ _mesa_Fogfv(pname, p);
+}
+
+
+void
+_mesa_Fogfv( GLenum pname, const GLfloat *params )
{
+ GET_CURRENT_CONTEXT(ctx);
GLenum m;
switch (pname) {