summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/get.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2000-04-07 16:27:26 +0000
committerBrian Paul <[email protected]>2000-04-07 16:27:26 +0000
commit2b2e925ea4a5652b0ab73b1efbce345a42663842 (patch)
tree9824128cf7662c51830bd3b5a0b74721a071a881 /src/mesa/main/get.c
parentede4887b1650b18b3a2db3f175fcc33826bbab4d (diff)
added GL_SGIX/SGIS_pixel_texture extension
Diffstat (limited to 'src/mesa/main/get.c')
-rw-r--r--src/mesa/main/get.c76
1 files changed, 75 insertions, 1 deletions
diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index 2552f305191..de7b108df84 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -1,4 +1,4 @@
-/* $Id: get.c,v 1.17 2000/04/04 15:14:10 brianp Exp $ */
+/* $Id: get.c,v 1.18 2000/04/07 16:27:26 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -58,6 +58,28 @@
#endif
+static GLenum
+pixel_texgen_mode(const GLcontext *ctx)
+{
+ if (ctx->Pixel.FragmentRgbSource == GL_CURRENT_RASTER_POSITION) {
+ if (ctx->Pixel.FragmentAlphaSource == GL_CURRENT_RASTER_POSITION) {
+ return GL_RGBA;
+ }
+ else {
+ return GL_RGB;
+ }
+ }
+ else {
+ if (ctx->Pixel.FragmentAlphaSource == GL_CURRENT_RASTER_POSITION) {
+ return GL_ALPHA;
+ }
+ else {
+ return GL_NONE;
+ }
+ }
+}
+
+
void
_mesa_GetBooleanv( GLenum pname, GLboolean *params )
@@ -1042,6 +1064,19 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
}
return;
+ /* GL_SGIS_pixel_texture */
+ case GL_PIXEL_TEXTURE_SGIS:
+ *params = ctx->Pixel.PixelTextureEnabled;
+ break;
+
+ /* GL_SGIX_pixel_texture */
+ case GL_PIXEL_TEX_GEN_SGIX:
+ *params = ctx->Pixel.PixelTextureEnabled;
+ break;
+ case GL_PIXEL_TEX_GEN_MODE_SGIX:
+ *params = (GLboolean) pixel_texgen_mode(ctx);
+ break;
+
default:
gl_error( ctx, GL_INVALID_ENUM, "glGetBooleanv" );
}
@@ -2034,6 +2069,19 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
}
return;
+ /* GL_SGIS_pixel_texture */
+ case GL_PIXEL_TEXTURE_SGIS:
+ *params = (GLdouble) ctx->Pixel.PixelTextureEnabled;
+ break;
+
+ /* GL_SGIX_pixel_texture */
+ case GL_PIXEL_TEX_GEN_SGIX:
+ *params = (GLdouble) ctx->Pixel.PixelTextureEnabled;
+ break;
+ case GL_PIXEL_TEX_GEN_MODE_SGIX:
+ *params = (GLdouble) pixel_texgen_mode(ctx);
+ break;
+
default:
gl_error( ctx, GL_INVALID_ENUM, "glGetDoublev" );
}
@@ -3003,6 +3051,19 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
}
return;
+ /* GL_SGIS_pixel_texture */
+ case GL_PIXEL_TEXTURE_SGIS:
+ *params = (GLfloat) ctx->Pixel.PixelTextureEnabled;
+ break;
+
+ /* GL_SGIX_pixel_texture */
+ case GL_PIXEL_TEX_GEN_SGIX:
+ *params = (GLfloat) ctx->Pixel.PixelTextureEnabled;
+ break;
+ case GL_PIXEL_TEX_GEN_MODE_SGIX:
+ *params = (GLfloat) pixel_texgen_mode(ctx);
+ break;
+
default:
gl_error( ctx, GL_INVALID_ENUM, "glGetFloatv" );
}
@@ -3995,6 +4056,19 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
}
return;
+ /* GL_SGIS_pixel_texture */
+ case GL_PIXEL_TEXTURE_SGIS:
+ *params = (GLint) ctx->Pixel.PixelTextureEnabled;
+ break;
+
+ /* GL_SGIX_pixel_texture */
+ case GL_PIXEL_TEX_GEN_SGIX:
+ *params = (GLint) ctx->Pixel.PixelTextureEnabled;
+ break;
+ case GL_PIXEL_TEX_GEN_MODE_SGIX:
+ *params = (GLint) pixel_texgen_mode(ctx);
+ break;
+
default:
gl_error( ctx, GL_INVALID_ENUM, "glGetIntegerv" );
}