Some initial RGB and RGBA floating point texture formats.
[mesa.git] / src / mesa / main / rastpos.c
index 218e4f7ed2eee457e943fd0824bcca9433c68fc7..5e7ef50b46ba70954c30f02f57505634a6db0ebd 100644 (file)
@@ -129,7 +129,7 @@ shade_rastpos(GLcontext *ctx,
               const GLfloat normal[3],
               GLfloat Rcolor[4],
               GLfloat Rspec[4],
-              GLuint *Rindex)
+              GLfloat *Rindex)
 {
    GLfloat (*base)[3] = ctx->Light._BaseColor;
    struct gl_light *light;
@@ -274,7 +274,7 @@ shade_rastpos(GLcontext *ctx,
       if (i > ind[MAT_INDEX_SPECULAR]) {
         i = ind[MAT_INDEX_SPECULAR];
       }
-      *Rindex = (GLuint) (GLint) i;
+      *Rindex = i;
    }
 }
 
@@ -380,7 +380,7 @@ raster_pos4f(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
       }
 
       /* ndc = clip / W */
-      d = (clip[3] == 0.0) ? 1.0 : 1.0F / clip[3];
+      d = (clip[3] == 0.0F) ? 1.0F : 1.0F / clip[3];
       ndc[0] = clip[0] * d;
       ndc[1] = clip[1] * d;
       ndc[2] = clip[2] * d;
@@ -411,70 +411,70 @@ raster_pos4f(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
 
 
 /** Calls _mesa_RasterPos4f() */
-void
+void GLAPIENTRY
 _mesa_RasterPos2d(GLdouble x, GLdouble y)
 {
    _mesa_RasterPos4f((GLfloat) x, (GLfloat) y, 0.0F, 1.0F);
 }
 
 /** Calls _mesa_RasterPos4f() */
-void
+void GLAPIENTRY
 _mesa_RasterPos2f(GLfloat x, GLfloat y)
 {
    _mesa_RasterPos4f(x, y, 0.0F, 1.0F);
 }
 
 /** Calls _mesa_RasterPos4f() */
-void
+void GLAPIENTRY
 _mesa_RasterPos2i(GLint x, GLint y)
 {
    _mesa_RasterPos4f((GLfloat) x, (GLfloat) y, 0.0F, 1.0F);
 }
 
 /** Calls _mesa_RasterPos4f() */
-void
+void GLAPIENTRY
 _mesa_RasterPos2s(GLshort x, GLshort y)
 {
    _mesa_RasterPos4f(x, y, 0.0F, 1.0F);
 }
 
 /** Calls _mesa_RasterPos4f() */
-void
+void GLAPIENTRY
 _mesa_RasterPos3d(GLdouble x, GLdouble y, GLdouble z)
 {
    _mesa_RasterPos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F);
 }
 
 /** Calls _mesa_RasterPos4f() */
-void
+void GLAPIENTRY
 _mesa_RasterPos3f(GLfloat x, GLfloat y, GLfloat z)
 {
    _mesa_RasterPos4f(x, y, z, 1.0F);
 }
 
 /** Calls _mesa_RasterPos4f() */
-void
+void GLAPIENTRY
 _mesa_RasterPos3i(GLint x, GLint y, GLint z)
 {
    _mesa_RasterPos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F);
 }
 
 /** Calls _mesa_RasterPos4f() */
-void
+void GLAPIENTRY
 _mesa_RasterPos3s(GLshort x, GLshort y, GLshort z)
 {
    _mesa_RasterPos4f(x, y, z, 1.0F);
 }
 
 /** Calls _mesa_RasterPos4f() */
-void
+void GLAPIENTRY
 _mesa_RasterPos4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
 {
    _mesa_RasterPos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w);
 }
 
 /** Calls raster_pos4f() */
-void
+void GLAPIENTRY
 _mesa_RasterPos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
 {
    GET_CURRENT_CONTEXT(ctx);
@@ -482,77 +482,77 @@ _mesa_RasterPos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
 }
 
 /** Calls _mesa_RasterPos4f() */
-void
+void GLAPIENTRY
 _mesa_RasterPos4i(GLint x, GLint y, GLint z, GLint w)
 {
    _mesa_RasterPos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w);
 }
 
 /** Calls _mesa_RasterPos4f() */
-void
+void GLAPIENTRY
 _mesa_RasterPos4s(GLshort x, GLshort y, GLshort z, GLshort w)
 {
    _mesa_RasterPos4f(x, y, z, w);
 }
 
 /** Calls _mesa_RasterPos4f() */
-void
+void GLAPIENTRY
 _mesa_RasterPos2dv(const GLdouble *v)
 {
    _mesa_RasterPos4f((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F);
 }
 
 /** Calls _mesa_RasterPos4f() */
-void
+void GLAPIENTRY
 _mesa_RasterPos2fv(const GLfloat *v)
 {
    _mesa_RasterPos4f(v[0], v[1], 0.0F, 1.0F);
 }
 
 /** Calls _mesa_RasterPos4f() */
-void
+void GLAPIENTRY
 _mesa_RasterPos2iv(const GLint *v)
 {
    _mesa_RasterPos4f((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F);
 }
 
 /** Calls _mesa_RasterPos4f() */
-void
+void GLAPIENTRY
 _mesa_RasterPos2sv(const GLshort *v)
 {
    _mesa_RasterPos4f(v[0], v[1], 0.0F, 1.0F);
 }
 
 /** Calls _mesa_RasterPos4f() */
-void
+void GLAPIENTRY
 _mesa_RasterPos3dv(const GLdouble *v)
 {
    _mesa_RasterPos4f((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F);
 }
 
 /** Calls _mesa_RasterPos4f() */
-void
+void GLAPIENTRY
 _mesa_RasterPos3fv(const GLfloat *v)
 {
    _mesa_RasterPos4f(v[0], v[1], v[2], 1.0F);
 }
 
 /** Calls _mesa_RasterPos4f() */
-void
+void GLAPIENTRY
 _mesa_RasterPos3iv(const GLint *v)
 {
    _mesa_RasterPos4f((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F);
 }
 
 /** Calls _mesa_RasterPos4f() */
-void
+void GLAPIENTRY
 _mesa_RasterPos3sv(const GLshort *v)
 {
    _mesa_RasterPos4f(v[0], v[1], v[2], 1.0F);
 }
 
 /** Calls _mesa_RasterPos4f() */
-void
+void GLAPIENTRY
 _mesa_RasterPos4dv(const GLdouble *v)
 {
    _mesa_RasterPos4f((GLfloat) v[0], (GLfloat) v[1], 
@@ -560,14 +560,14 @@ _mesa_RasterPos4dv(const GLdouble *v)
 }
 
 /** Calls _mesa_RasterPos4f() */
-void
+void GLAPIENTRY
 _mesa_RasterPos4fv(const GLfloat *v)
 {
    _mesa_RasterPos4f(v[0], v[1], v[2], v[3]);
 }
 
 /** Calls _mesa_RasterPos4f() */
-void
+void GLAPIENTRY
 _mesa_RasterPos4iv(const GLint *v)
 {
    _mesa_RasterPos4f((GLfloat) v[0], (GLfloat) v[1], 
@@ -575,7 +575,7 @@ _mesa_RasterPos4iv(const GLint *v)
 }
 
 /** Calls _mesa_RasterPos4f() */
-void
+void GLAPIENTRY
 _mesa_RasterPos4sv(const GLshort *v)
 {
    _mesa_RasterPos4f(v[0], v[1], v[2], v[3]);
@@ -664,147 +664,147 @@ window_pos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
 }
 
 
-void
+void GLAPIENTRY
 _mesa_WindowPos2dMESA(GLdouble x, GLdouble y)
 {
    window_pos4f((GLfloat) x, (GLfloat) y, 0.0F, 1.0F);
 }
 
-void
+void GLAPIENTRY
 _mesa_WindowPos2fMESA(GLfloat x, GLfloat y)
 {
    window_pos4f(x, y, 0.0F, 1.0F);
 }
 
-void
+void GLAPIENTRY
 _mesa_WindowPos2iMESA(GLint x, GLint y)
 {
    window_pos4f((GLfloat) x, (GLfloat) y, 0.0F, 1.0F);
 }
 
-void
+void GLAPIENTRY
 _mesa_WindowPos2sMESA(GLshort x, GLshort y)
 {
    window_pos4f(x, y, 0.0F, 1.0F);
 }
 
-void
+void GLAPIENTRY
 _mesa_WindowPos3dMESA(GLdouble x, GLdouble y, GLdouble z)
 {
    window_pos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F);
 }
 
-void
+void GLAPIENTRY
 _mesa_WindowPos3fMESA(GLfloat x, GLfloat y, GLfloat z)
 {
    window_pos4f(x, y, z, 1.0F);
 }
 
-void
+void GLAPIENTRY
 _mesa_WindowPos3iMESA(GLint x, GLint y, GLint z)
 {
    window_pos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F);
 }
 
-void
+void GLAPIENTRY
 _mesa_WindowPos3sMESA(GLshort x, GLshort y, GLshort z)
 {
    window_pos4f(x, y, z, 1.0F);
 }
 
-void
+void GLAPIENTRY
 _mesa_WindowPos4dMESA(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
 {
    window_pos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w);
 }
 
-void
+void GLAPIENTRY
 _mesa_WindowPos4fMESA(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
 {
    window_pos4f(x, y, z, w);
 }
 
-void
+void GLAPIENTRY
 _mesa_WindowPos4iMESA(GLint x, GLint y, GLint z, GLint w)
 {
    window_pos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w);
 }
 
-void
+void GLAPIENTRY
 _mesa_WindowPos4sMESA(GLshort x, GLshort y, GLshort z, GLshort w)
 {
    window_pos4f(x, y, z, w);
 }
 
-void
+void GLAPIENTRY
 _mesa_WindowPos2dvMESA(const GLdouble *v)
 {
    window_pos4f((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F);
 }
 
-void
+void GLAPIENTRY
 _mesa_WindowPos2fvMESA(const GLfloat *v)
 {
    window_pos4f(v[0], v[1], 0.0F, 1.0F);
 }
 
-void
+void GLAPIENTRY
 _mesa_WindowPos2ivMESA(const GLint *v)
 {
    window_pos4f((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F);
 }
 
-void
+void GLAPIENTRY
 _mesa_WindowPos2svMESA(const GLshort *v)
 {
    window_pos4f(v[0], v[1], 0.0F, 1.0F);
 }
 
-void
+void GLAPIENTRY
 _mesa_WindowPos3dvMESA(const GLdouble *v)
 {
    window_pos4f((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F);
 }
 
-void
+void GLAPIENTRY
 _mesa_WindowPos3fvMESA(const GLfloat *v)
 {
    window_pos4f(v[0], v[1], v[2], 1.0);
 }
 
-void
+void GLAPIENTRY
 _mesa_WindowPos3ivMESA(const GLint *v)
 {
    window_pos4f((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F);
 }
 
-void
+void GLAPIENTRY
 _mesa_WindowPos3svMESA(const GLshort *v)
 {
    window_pos4f(v[0], v[1], v[2], 1.0F);
 }
 
-void
+void GLAPIENTRY
 _mesa_WindowPos4dvMESA(const GLdouble *v)
 {
    window_pos4f((GLfloat) v[0], (GLfloat) v[1], 
                         (GLfloat) v[2], (GLfloat) v[3]);
 }
 
-void
+void GLAPIENTRY
 _mesa_WindowPos4fvMESA(const GLfloat *v)
 {
    window_pos4f(v[0], v[1], v[2], v[3]);
 }
 
-void
+void GLAPIENTRY
 _mesa_WindowPos4ivMESA(const GLint *v)
 {
    window_pos4f((GLfloat) v[0], (GLfloat) v[1], 
                         (GLfloat) v[2], (GLfloat) v[3]);
 }
 
-void
+void GLAPIENTRY
 _mesa_WindowPos4svMESA(const GLshort *v)
 {
    window_pos4f(v[0], v[1], v[2], v[3]);
@@ -872,7 +872,7 @@ void _mesa_init_rastpos( GLcontext * ctx )
    ASSIGN_4V( ctx->Current.RasterPos, 0.0, 0.0, 0.0, 1.0 );
    ctx->Current.RasterDistance = 0.0;
    ASSIGN_4V( ctx->Current.RasterColor, 1.0, 1.0, 1.0, 1.0 );
-   ctx->Current.RasterIndex = 1;
+   ctx->Current.RasterIndex = 1.0;
    for (i=0; i<MAX_TEXTURE_UNITS; i++)
       ASSIGN_4V( ctx->Current.RasterTexCoords[i], 0.0, 0.0, 0.0, 1.0 );
    ctx->Current.RasterPosValid = GL_TRUE;