-/* $Id: config.h,v 1.13 2000/05/07 20:41:30 brianp Exp $ */
+/* $Id: config.h,v 1.14 2000/05/23 20:10:49 brianp Exp $ */
/*
* Mesa 3-D graphics library
#define MAX_CONVOLUTION_WIDTH 5
#define MAX_CONVOLUTION_HEIGHT 5
+/* GL_ARB_texture_compression */
+#define MAX_COMPRESSED_TEXTURE_FORMATS 25
+
+
/*
* Mesa-specific parameters
-/* $Id: context.c,v 1.66 2000/05/22 16:33:20 brianp Exp $ */
+/* $Id: context.c,v 1.67 2000/05/23 20:10:49 brianp Exp $ */
/*
* Mesa 3-D graphics library
ctx->Const.MaxColorTableSize = MAX_COLOR_TABLE_SIZE;
ctx->Const.MaxConvolutionWidth = MAX_CONVOLUTION_WIDTH;
ctx->Const.MaxConvolutionHeight = MAX_CONVOLUTION_HEIGHT;
+ ctx->Const.NumCompressedTextureFormats = 0;
/* Modelview matrix */
gl_matrix_ctr( &ctx->ModelView );
ctx->Hint.LineSmooth = GL_DONT_CARE;
ctx->Hint.PolygonSmooth = GL_DONT_CARE;
ctx->Hint.Fog = GL_DONT_CARE;
-
ctx->Hint.AllowDrawWin = GL_TRUE;
ctx->Hint.AllowDrawFrg = GL_TRUE;
ctx->Hint.AllowDrawMem = GL_TRUE;
ctx->Hint.StrictLighting = GL_TRUE;
+ ctx->Hint.ClipVolumeClipping = GL_DONT_CARE;
+ ctx->Hint.TextureCompression = GL_DONT_CARE;
/* Histogram group */
ctx->Histogram.Width = 0;
-/* $Id: dlist.c,v 1.39 2000/05/19 13:12:29 brianp Exp $ */
+/* $Id: dlist.c,v 1.40 2000/05/23 20:10:49 brianp Exp $ */
/*
* Mesa 3-D graphics library
+/* GL_ARB_transpose_matrix */
+
static void save_LoadTransposeMatrixdARB( const GLdouble m[16] )
{
GLdouble tm[16];
}
+/* GL_ARB_texture_compression */
+static void
+save_CompressedTexImage1DARB(GLenum target, GLint level,
+ GLenum internalformat, GLsizei width,
+ GLint border, GLsizei imageSize,
+ const GLvoid *data)
+{
+}
+
+
+static void
+save_CompressedTexImage2DARB(GLenum target, GLint level,
+ GLenum internalformat, GLsizei width,
+ GLsizei height, GLint border, GLsizei imageSize,
+ const GLvoid *data)
+{
+}
+
+
+static void
+save_CompressedTexImage3DARB(GLenum target, GLint level,
+ GLenum internalformat, GLsizei width,
+ GLsizei height, GLsizei depth, GLint border,
+ GLsizei imageSize, const GLvoid *data)
+{
+}
+
+
+static void
+save_CompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset,
+ GLsizei width, GLenum format,
+ GLsizei imageSize, const GLvoid *data)
+{
+}
+
+
+static void
+save_CompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset,
+ GLint yoffset, GLsizei width, GLsizei height,
+ GLenum format, GLsizei imageSize,
+ const GLvoid *data)
+{
+}
+
+
+static void
+save_CompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset,
+ GLint yoffset, GLint zoffset, GLsizei width,
+ GLsizei height, GLsizei depth, GLenum format,
+ GLsizei imageSize, const GLvoid *data)
+{
+}
+
+
+/* GL_SGIS_pixel_texture */
+
static void save_PixelTexGenParameteriSGIS(GLenum target, GLint value)
{
GET_CURRENT_CONTEXT(ctx);
table->MultTransposeMatrixdARB = save_MultTransposeMatrixdARB;
table->MultTransposeMatrixfARB = save_MultTransposeMatrixfARB;
+ /* ARB 12. GL_ARB_texture_compression */
+ table->CompressedTexImage3DARB = save_CompressedTexImage3DARB;
+ table->CompressedTexImage2DARB = save_CompressedTexImage2DARB;
+ table->CompressedTexImage1DARB = save_CompressedTexImage1DARB;
+ table->CompressedTexSubImage3DARB = save_CompressedTexSubImage3DARB;
+ table->CompressedTexSubImage2DARB = save_CompressedTexSubImage2DARB;
+ table->CompressedTexSubImage1DARB = save_CompressedTexSubImage1DARB;
+ table->GetCompressedTexImageARB = _mesa_GetCompressedTexImageARB;
}
-/* $Id: extensions.c,v 1.27 2000/05/22 18:46:52 brianp Exp $ */
+/* $Id: extensions.c,v 1.28 2000/05/23 20:10:49 brianp Exp $ */
/*
* Mesa 3-D graphics library
static struct { int enabled; const char *name; } default_extensions[] = {
{ DEFAULT_OFF, "GL_ARB_imaging" }, /* in progress */
{ DEFAULT_ON, "GL_ARB_multitexture" },
+ { DEFAULT_OFF, "GL_ARB_texture_compression" }, /* in progress */
{ DEFAULT_OFF, "GL_ARB_texture_cube_map" }, /* in progress */
{ ALWAYS_ENABLED, "GL_ARB_tranpose_matrix" },
{ ALWAYS_ENABLED, "GL_EXT_abgr" },
ctx->Extensions.HaveTextureLodBias = gl_extension_is_enabled(ctx, "GL_EXT_texture_lod_bias");
ctx->Extensions.HaveHpOcclusionTest = gl_extension_is_enabled(ctx, "GL_HP_occlusion_test");
ctx->Extensions.HaveTextureCubeMap = gl_extension_is_enabled(ctx, "GL_ARB_texture_cube_map");
+ ctx->Extensions.HaveTextureCompression = gl_extension_is_enabled(ctx, "GL_ARB_texture_compression");
}
-/* $Id: get.c,v 1.28 2000/05/23 17:14:49 brianp Exp $ */
+/* $Id: get.c,v 1.29 2000/05/23 20:10:49 brianp Exp $ */
/*
* Mesa 3-D graphics library
gl_error(ctx, GL_INVALID_ENUM, "glGetBooleanv");
break;
+ /* GL_ARB_texture_compression */
+ case GL_TEXTURE_COMPRESSION_HINT_ARB:
+ if (ctx->Extensions.HaveTextureCompression) {
+ *params = INT_TO_BOOL(ctx->Hint.TextureCompression);
+ }
+ else
+ gl_error(ctx, GL_INVALID_ENUM, "glGetBooleanv");
+ break;
+ case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB:
+ if (ctx->Extensions.HaveTextureCompression) {
+ *params = INT_TO_BOOL(ctx->Const.NumCompressedTextureFormats);
+ }
+ else
+ gl_error(ctx, GL_INVALID_ENUM, "glGetBooleanv");
+ break;
+ case GL_COMPRESSED_TEXTURE_FORMATS_ARB:
+ if (ctx->Extensions.HaveTextureCompression) {
+ GLuint i;
+ for (i = 0; i < ctx->Const.NumCompressedTextureFormats; i++)
+ params[i] = INT_TO_BOOL(ctx->Const.CompressedTextureFormats[i]);
+ }
+ else
+ gl_error(ctx, GL_INVALID_ENUM, "glGetBooleanv");
+ break;
+
/* GL_PGI_misc_hints */
case GL_STRICT_DEPTHFUNC_HINT_PGI:
*params = ENUM_TO_BOOL(GL_NICEST);
gl_error(ctx, GL_INVALID_ENUM, "glGetDoublev");
return;
+ /* GL_ARB_texture_compression */
+ case GL_TEXTURE_COMPRESSION_HINT_ARB:
+ if (ctx->Extensions.HaveTextureCompression) {
+ *params = (GLdouble) ctx->Hint.TextureCompression;
+ }
+ else
+ gl_error(ctx, GL_INVALID_ENUM, "glGetDoublev");
+ break;
+ case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB:
+ if (ctx->Extensions.HaveTextureCompression) {
+ *params = (GLdouble) ctx->Const.NumCompressedTextureFormats;
+ }
+ else
+ gl_error(ctx, GL_INVALID_ENUM, "glGetDoublev");
+ break;
+ case GL_COMPRESSED_TEXTURE_FORMATS_ARB:
+ if (ctx->Extensions.HaveTextureCompression) {
+ GLuint i;
+ for (i = 0; i < ctx->Const.NumCompressedTextureFormats; i++)
+ params[i] = (GLdouble) ctx->Const.CompressedTextureFormats[i];
+ }
+ else
+ gl_error(ctx, GL_INVALID_ENUM, "glGetDoublev");
+ break;
+
/* GL_PGI_misc_hints */
case GL_STRICT_DEPTHFUNC_HINT_PGI:
*params = ENUM_TO_DOUBLE(GL_NICEST);
gl_error(ctx, GL_INVALID_ENUM, "glGetFloatv");
return;
+ /* GL_ARB_texture_compression */
+ case GL_TEXTURE_COMPRESSION_HINT_ARB:
+ if (ctx->Extensions.HaveTextureCompression) {
+ *params = (GLfloat) ctx->Hint.TextureCompression;
+ }
+ else
+ gl_error(ctx, GL_INVALID_ENUM, "glGetFloatv");
+ break;
+ case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB:
+ if (ctx->Extensions.HaveTextureCompression) {
+ *params = (GLfloat) ctx->Const.NumCompressedTextureFormats;
+ }
+ else
+ gl_error(ctx, GL_INVALID_ENUM, "glGetFloatv");
+ break;
+ case GL_COMPRESSED_TEXTURE_FORMATS_ARB:
+ if (ctx->Extensions.HaveTextureCompression) {
+ GLuint i;
+ for (i = 0; i < ctx->Const.NumCompressedTextureFormats; i++)
+ params[i] = (GLfloat) ctx->Const.CompressedTextureFormats[i];
+ }
+ else
+ gl_error(ctx, GL_INVALID_ENUM, "glGetFloatv");
+ break;
+
/* GL_PGI_misc_hints */
case GL_STRICT_DEPTHFUNC_HINT_PGI:
*params = ENUM_TO_FLOAT(GL_NICEST);
gl_error(ctx, GL_INVALID_ENUM, "glGetIntegerv");
return;
+ /* GL_ARB_texture_compression */
+ case GL_TEXTURE_COMPRESSION_HINT_ARB:
+ if (ctx->Extensions.HaveTextureCompression) {
+ *params = (GLint) ctx->Hint.TextureCompression;
+ }
+ else
+ gl_error(ctx, GL_INVALID_ENUM, "glGetIntegerv");
+ break;
+ case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB:
+ if (ctx->Extensions.HaveTextureCompression) {
+ *params = (GLint) ctx->Const.NumCompressedTextureFormats;
+ }
+ else
+ gl_error(ctx, GL_INVALID_ENUM, "glGetIntegerv");
+ break;
+ case GL_COMPRESSED_TEXTURE_FORMATS_ARB:
+ if (ctx->Extensions.HaveTextureCompression) {
+ GLuint i;
+ for (i = 0; i < ctx->Const.NumCompressedTextureFormats; i++)
+ params[i] = (GLint) ctx->Const.CompressedTextureFormats[i];
+ }
+ else
+ gl_error(ctx, GL_INVALID_ENUM, "glGetIntegerv");
+ break;
+
/* GL_PGI_misc_hints */
case GL_STRICT_DEPTHFUNC_HINT_PGI:
*params = (GL_NICEST);
-/* $Id: hint.c,v 1.3 2000/04/10 15:52:26 brianp Exp $ */
+/* $Id: hint.c,v 1.4 2000/05/23 20:10:50 brianp Exp $ */
/*
* Mesa 3-D graphics library
case GL_NATIVE_GRAPHICS_HANDLE_PGI:
break;
- /* GL_EXT_clip_volume_hint */
+ /* GL_EXT_clip_volume_hint */
case GL_CLIP_VOLUME_CLIPPING_HINT_EXT:
ctx->Hint.ClipVolumeClipping = mode;
break;
+ /* GL_ARB_texture_compression */
+ case GL_TEXTURE_COMPRESSION_HINT_ARB:
+ if (ctx->Extensions.HaveTextureCompression) {
+ ctx->Hint.TextureCompression = mode;
+ }
+ else {
+ gl_error(ctx, GL_INVALID_ENUM, "glHint(target)");
+ }
+ break;
+
default:
- gl_error( ctx, GL_INVALID_ENUM, "glHint(target)" );
+ gl_error(ctx, GL_INVALID_ENUM, "glHint(target)");
return GL_FALSE;
}
-/* $Id: state.c,v 1.12 2000/05/10 22:36:05 brianp Exp $ */
+/* $Id: state.c,v 1.13 2000/05/23 20:10:50 brianp Exp $ */
/*
* Mesa 3-D graphics library
exec->LoadTransposeMatrixfARB = _mesa_LoadTransposeMatrixfARB;
exec->MultTransposeMatrixdARB = _mesa_MultTransposeMatrixdARB;
exec->MultTransposeMatrixfARB = _mesa_MultTransposeMatrixfARB;
+
+ /* ARB 12. GL_ARB_texture_compression */
+ exec->CompressedTexImage3DARB = _mesa_CompressedTexImage3DARB;
+ exec->CompressedTexImage2DARB = _mesa_CompressedTexImage2DARB;
+ exec->CompressedTexImage1DARB = _mesa_CompressedTexImage1DARB;
+ exec->CompressedTexSubImage3DARB = _mesa_CompressedTexSubImage3DARB;
+ exec->CompressedTexSubImage2DARB = _mesa_CompressedTexSubImage2DARB;
+ exec->CompressedTexSubImage1DARB = _mesa_CompressedTexSubImage1DARB;
+ exec->GetCompressedTexImageARB = _mesa_GetCompressedTexImageARB;
+
}
+
/**********************************************************************/
/***** State update logic *****/
/**********************************************************************/
}
}
}
+
+
+
+void
+_mesa_CompressedTexImage1DARB(GLenum target, GLint level,
+ GLenum internalformat, GLsizei width,
+ GLint border, GLsizei imageSize,
+ const GLvoid *data)
+{
+}
+
+
+void
+_mesa_CompressedTexImage2DARB(GLenum target, GLint level,
+ GLenum internalformat, GLsizei width,
+ GLsizei height, GLint border, GLsizei imageSize,
+ const GLvoid *data)
+{
+}
+
+
+void
+_mesa_CompressedTexImage3DARB(GLenum target, GLint level,
+ GLenum internalformat, GLsizei width,
+ GLsizei height, GLsizei depth, GLint border,
+ GLsizei imageSize, const GLvoid *data)
+{
+}
+
+
+void
+_mesa_CompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset,
+ GLsizei width, GLenum format,
+ GLsizei imageSize, const GLvoid *data)
+{
+}
+
+
+void
+_mesa_CompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset,
+ GLint yoffset, GLsizei width, GLsizei height,
+ GLenum format, GLsizei imageSize,
+ const GLvoid *data)
+{
+}
+
+
+void
+_mesa_CompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset,
+ GLint yoffset, GLint zoffset, GLsizei width,
+ GLsizei height, GLsizei depth, GLenum format,
+ GLsizei imageSize, const GLvoid *data)
+{
+}
+
+
+void
+_mesa_GetCompressedTexImageARB(GLenum target, GLint lod, GLvoid *img)
+{
+}
-/* $Id: teximage.h,v 1.8 2000/05/23 17:14:49 brianp Exp $ */
+/* $Id: teximage.h,v 1.9 2000/05/23 20:10:50 brianp Exp $ */
/*
* Mesa 3-D graphics library
GLint xoffset, GLint yoffset, GLint zoffset,
GLint x, GLint y, GLsizei width, GLsizei height );
+
+
+extern void
+_mesa_CompressedTexImage1DARB(GLenum target, GLint level,
+ GLenum internalformat, GLsizei width,
+ GLint border, GLsizei imageSize,
+ const GLvoid *data);
+
+extern void
+_mesa_CompressedTexImage2DARB(GLenum target, GLint level,
+ GLenum internalformat, GLsizei width,
+ GLsizei height, GLint border, GLsizei imageSize,
+ const GLvoid *data);
+
+extern void
+_mesa_CompressedTexImage3DARB(GLenum target, GLint level,
+ GLenum internalformat, GLsizei width,
+ GLsizei height, GLsizei depth, GLint border,
+ GLsizei imageSize, const GLvoid *data);
+
+
+extern void
+_mesa_CompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset,
+ GLsizei width, GLenum format,
+ GLsizei imageSize, const GLvoid *data);
+
+extern void
+_mesa_CompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset,
+ GLint yoffset, GLsizei width, GLsizei height,
+ GLenum format, GLsizei imageSize,
+ const GLvoid *data);
+
+extern void
+_mesa_CompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset,
+ GLint yoffset, GLint zoffset, GLsizei width,
+ GLsizei height, GLsizei depth, GLenum format,
+ GLsizei imageSize, const GLvoid *data);
+
+extern void
+_mesa_GetCompressedTexImageARB(GLenum target, GLint lod, GLvoid *img);
+
+
#endif
-/* $Id: texstate.c,v 1.12 2000/05/23 17:14:49 brianp Exp $ */
+/* $Id: texstate.c,v 1.13 2000/05/23 20:10:50 brianp Exp $ */
/*
* Mesa 3-D graphics library
const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
const struct gl_texture_image *img = NULL;
GLuint dimensions;
+ GLboolean isProxy;
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glGetTexLevelParameter");
return;
}
+ isProxy = (target == GL_PROXY_TEXTURE_1D) ||
+ (target == GL_PROXY_TEXTURE_2D) ||
+ (target == GL_PROXY_TEXTURE_3D) ||
+ (target == GL_PROXY_TEXTURE_CUBE_MAP_ARB);
+
switch (pname) {
case GL_TEXTURE_WIDTH:
*params = img->Width;
case GL_TEXTURE_INDEX_SIZE_EXT:
*params = img->IndexBits;
return;
+
+ /* GL_ARB_texture_compression */
+ case GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB:
+ if (ctx->Extensions.HaveTextureCompression) {
+ if (img->IsCompressed && !isProxy)
+ *params = img->CompressedSize;
+ else
+ gl_error(ctx, GL_INVALID_OPERATION,
+ "glGetTexLevelParameter[if]v(pname)");
+ }
+ else {
+ gl_error(ctx, GL_INVALID_ENUM, "glGetTexLevelParameter[if]v(pname)");
+ }
+ return;
+ case GL_TEXTURE_COMPRESSED_ARB:
+ if (ctx->Extensions.HaveTextureCompression) {
+ *params = (GLint) img->IsCompressed;
+ }
+ else {
+ gl_error(ctx, GL_INVALID_ENUM, "glGetTexLevelParameter[if]v(pname)");
+ }
+ return;
+
default:
- gl_error( ctx, GL_INVALID_ENUM,
- "glGetTexLevelParameter[if]v(pname)" );
+ gl_error(ctx, GL_INVALID_ENUM, "glGetTexLevelParameter[if]v(pname)");
}
}