-/* $Id: colortab.c,v 1.4 1999/11/11 01:22:25 brianp Exp $ */
+/* $Id: colortab.c,v 1.10 2000/03/21 01:03:40 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
GET_CURRENT_CONTEXT(ctx);
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
struct gl_texture_object *texObj;
- struct gl_palette *palette;
+ struct gl_color_table *palette;
GLboolean proxy = GL_FALSE;
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glColorTable");
assert(palette);
- if (!gl_is_legal_format_and_type(format, type)) {
+ if (!_mesa_is_legal_format_and_type(format, type)) {
gl_error(ctx, GL_INVALID_ENUM, "glColorTable(format or type)");
return;
}
GET_CURRENT_CONTEXT(ctx);
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
struct gl_texture_object *texObj;
- struct gl_palette *palette;
+ struct gl_color_table *palette;
GLint comps;
GLubyte *dest;
assert(palette);
- if (!gl_is_legal_format_and_type(format, type)) {
+ if (!_mesa_is_legal_format_and_type(format, type)) {
gl_error(ctx, GL_INVALID_ENUM, "glColorSubTable(format or type)");
return;
}
return;
}
- comps = gl_components_in_format(format);
+ comps = _mesa_components_in_format(format);
assert(comps > 0); /* error should be caught sooner */
if (start + count > palette->Size) {
{
GET_CURRENT_CONTEXT(ctx);
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
- struct gl_palette *palette;
+ struct gl_color_table *palette;
GLubyte rgba[MAX_TEXTURE_PALETTE_SIZE][4];
GLint i;
- ASSERT_OUTSIDE_BEGIN_END(ctx, "glGetBooleanv");
+ ASSERT_OUTSIDE_BEGIN_END(ctx, "glGetColorTable");
switch (target) {
case GL_TEXTURE_1D:
return;
}
- gl_pack_rgba_span(ctx, palette->Size, (const GLubyte (*)[]) rgba,
- format, type, table, &ctx->Pack, GL_FALSE);
+ _mesa_pack_rgba_span(ctx, palette->Size, (const GLubyte (*)[]) rgba,
+ format, type, table, &ctx->Pack, GL_FALSE);
- gl_problem(ctx, "glGetColorTable not implemented!");
(void) format;
(void) type;
(void) table;
{
GET_CURRENT_CONTEXT(ctx);
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
- struct gl_palette *palette;
+ struct gl_color_table *palette;
ASSERT_OUTSIDE_BEGIN_END(ctx, "glGetColorTableParameter");
case GL_TEXTURE_3D:
palette = &texUnit->CurrentD[3]->Palette;
break;
+ case GL_PROXY_TEXTURE_1D:
+ palette = &ctx->Texture.Proxy1D->Palette;
+ break;
+ case GL_PROXY_TEXTURE_2D:
+ palette = &ctx->Texture.Proxy2D->Palette;
+ break;
+ case GL_PROXY_TEXTURE_3D:
+ palette = &ctx->Texture.Proxy3D->Palette;
+ break;
case GL_SHARED_TEXTURE_PALETTE_EXT:
palette = &ctx->Texture.Palette;
break;