1f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* 2f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Mesa 3-D graphics library 3f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Version: 7.1 4f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * 5f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. 6f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * 7f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Permission is hereby granted, free of charge, to any person obtaining a 8f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * copy of this software and associated documentation files (the "Software"), 9f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * to deal in the Software without restriction, including without limitation 10f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * the rights to use, copy, modify, merge, publish, distribute, sublicense, 11f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * and/or sell copies of the Software, and to permit persons to whom the 12f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Software is furnished to do so, subject to the following conditions: 13f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * 14f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * The above copyright notice and this permission notice shall be included 15f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * in all copies or substantial portions of the Software. 16f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * 17f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 18f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 20f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 21f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */ 24f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 25f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 26f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "glheader.h" 27f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "bufferobj.h" 28f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "colortab.h" 29f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "context.h" 30f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "image.h" 31f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "macros.h" 32f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "mfeatures.h" 33f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "mtypes.h" 34f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "pack.h" 35f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "pbo.h" 36f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "state.h" 37f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "teximage.h" 38f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "texstate.h" 39f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "main/dispatch.h" 40f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 41f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 42f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#if FEATURE_colortable 43f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 44f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid GLAPIENTRY 45f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org_mesa_ColorTable( GLenum target, GLenum internalFormat, 46f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org GLsizei width, GLenum format, GLenum type, 47f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org const GLvoid *data ) 48f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org{ 49f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org GET_CURRENT_CONTEXT(ctx); 50f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); 51f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org _mesa_error(ctx, GL_INVALID_ENUM, "glColorTable(target)"); 52f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org} 53f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 54f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 55f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 56f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid GLAPIENTRY 57f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org_mesa_ColorSubTable( GLenum target, GLsizei start, 58f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org GLsizei count, GLenum format, GLenum type, 59f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org const GLvoid *data ) 60f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org{ 61f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org GET_CURRENT_CONTEXT(ctx); 62f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); 63f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org _mesa_error(ctx, GL_INVALID_ENUM, "glColorSubTable(target)"); 64f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org} 65f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 66f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 67f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 68f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstatic void GLAPIENTRY 69f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org_mesa_CopyColorTable(GLenum target, GLenum internalformat, 70f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org GLint x, GLint y, GLsizei width) 71f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org{ 72f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org GET_CURRENT_CONTEXT(ctx); 73f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); 74f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org _mesa_error(ctx, GL_INVALID_ENUM, "glCopyColorTable(target)"); 75f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org} 76f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 77f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 78f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 79f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstatic void GLAPIENTRY 80f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org_mesa_CopyColorSubTable(GLenum target, GLsizei start, 81f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org GLint x, GLint y, GLsizei width) 82f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org{ 83f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org GET_CURRENT_CONTEXT(ctx); 84f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); 85f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org _mesa_error(ctx, GL_INVALID_ENUM, "glCopyColorSubTable(target)"); 86f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org} 87f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 88f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 89f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 90f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstatic void GLAPIENTRY 91f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org_mesa_GetnColorTableARB( GLenum target, GLenum format, GLenum type, 92f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org GLsizei bufSize, GLvoid *data ) 93f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org{ 94f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org GET_CURRENT_CONTEXT(ctx); 95f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); 96f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org _mesa_error(ctx, GL_INVALID_ENUM, "glGetnColorTableARB(target)"); 97f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org} 98f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 99f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 100f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstatic void GLAPIENTRY 101f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org_mesa_GetColorTable( GLenum target, GLenum format, 102f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org GLenum type, GLvoid *data ) 103f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org{ 104f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org GET_CURRENT_CONTEXT(ctx); 105f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); 106f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org _mesa_error(ctx, GL_INVALID_ENUM, "glGetColorTable(target)"); 107f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org} 108f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 109f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 110f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstatic void GLAPIENTRY 111f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org_mesa_ColorTableParameterfv(GLenum target, GLenum pname, const GLfloat *params) 112f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org{ 113f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org /* no extensions use this function */ 114f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org GET_CURRENT_CONTEXT(ctx); 115f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); 116f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org _mesa_error(ctx, GL_INVALID_ENUM, "glColorTableParameterfv(target)"); 117f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org} 118f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 119f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 120f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 121f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstatic void GLAPIENTRY 122f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org_mesa_ColorTableParameteriv(GLenum target, GLenum pname, const GLint *params) 123f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org{ 124f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org /* no extensions use this function */ 125f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org GET_CURRENT_CONTEXT(ctx); 126f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); 127f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org _mesa_error(ctx, GL_INVALID_ENUM, "glColorTableParameteriv(target)"); 128f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org} 129f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 130f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 131f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 132f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstatic void GLAPIENTRY 133f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org_mesa_GetColorTableParameterfv( GLenum target, GLenum pname, GLfloat *params ) 134f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org{ 135f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org GET_CURRENT_CONTEXT(ctx); 136f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org ASSERT_OUTSIDE_BEGIN_END(ctx); 137f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org _mesa_error(ctx, GL_INVALID_ENUM, "glGetColorTableParameterfv(target)"); 138f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org} 139f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 140f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 141f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 142f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstatic void GLAPIENTRY 143f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org_mesa_GetColorTableParameteriv( GLenum target, GLenum pname, GLint *params ) 144f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org{ 145f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org GET_CURRENT_CONTEXT(ctx); 146f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org ASSERT_OUTSIDE_BEGIN_END(ctx); 147f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org _mesa_error(ctx, GL_INVALID_ENUM, "glGetColorTableParameteriv(target)"); 148f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org} 149f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 150f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 151f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid 152f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org_mesa_init_colortable_dispatch(struct _glapi_table *disp) 153f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org{ 154f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org SET_ColorSubTable(disp, _mesa_ColorSubTable); 155f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org SET_ColorTable(disp, _mesa_ColorTable); 156f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org SET_ColorTableParameterfv(disp, _mesa_ColorTableParameterfv); 157f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org SET_ColorTableParameteriv(disp, _mesa_ColorTableParameteriv); 158f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org SET_CopyColorSubTable(disp, _mesa_CopyColorSubTable); 159f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org SET_CopyColorTable(disp, _mesa_CopyColorTable); 160f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org SET_GetColorTable(disp, _mesa_GetColorTable); 161f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org SET_GetColorTableParameterfv(disp, _mesa_GetColorTableParameterfv); 162f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org SET_GetColorTableParameteriv(disp, _mesa_GetColorTableParameteriv); 163f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 164f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org /* GL_ARB_robustness */ 165f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org SET_GetnColorTableARB(disp, _mesa_GetnColorTableARB); 166f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org} 167f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 168f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 169f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#endif /* FEATURE_colortable */ 170