#endif
#include "clear.h"
#include "clip.h"
-#if FEATURE_colortable
#include "colortab.h"
-#endif
#include "context.h"
#if FEATURE_convolve
#include "convolve.h"
SET_BlendEquation(exec, _mesa_BlendEquation);
SET_BlendEquationSeparateEXT(exec, _mesa_BlendEquationSeparateEXT);
-#if FEATURE_colortable
- SET_ColorSubTable(exec, _mesa_ColorSubTable);
- SET_ColorTable(exec, _mesa_ColorTable);
- SET_ColorTableParameterfv(exec, _mesa_ColorTableParameterfv);
- SET_ColorTableParameteriv(exec, _mesa_ColorTableParameteriv);
- SET_CopyColorSubTable(exec, _mesa_CopyColorSubTable);
- SET_CopyColorTable(exec, _mesa_CopyColorTable);
- SET_GetColorTable(exec, _mesa_GetColorTable);
- SET_GetColorTableParameterfv(exec, _mesa_GetColorTableParameterfv);
- SET_GetColorTableParameteriv(exec, _mesa_GetColorTableParameteriv);
-#endif
+ _mesa_init_colortable_dispatch(exec);
#if FEATURE_convolve
SET_ConvolutionFilter1D(exec, _mesa_ConvolutionFilter1D);
#include "state.h"
#include "teximage.h"
#include "texstate.h"
+#include "glapi/dispatch.h"
+
+
+#if FEATURE_colortable
/**
-void GLAPIENTRY
+static void GLAPIENTRY
_mesa_CopyColorTable(GLenum target, GLenum internalformat,
GLint x, GLint y, GLsizei width)
{
-void GLAPIENTRY
+static void GLAPIENTRY
_mesa_CopyColorSubTable(GLenum target, GLsizei start,
GLint x, GLint y, GLsizei width)
{
-void GLAPIENTRY
+static void GLAPIENTRY
_mesa_GetColorTable( GLenum target, GLenum format,
GLenum type, GLvoid *data )
{
-void GLAPIENTRY
+static void GLAPIENTRY
_mesa_ColorTableParameterfv(GLenum target, GLenum pname, const GLfloat *params)
{
GLfloat *scale, *bias;
-void GLAPIENTRY
+static void GLAPIENTRY
_mesa_ColorTableParameteriv(GLenum target, GLenum pname, const GLint *params)
{
GLfloat fparams[4];
-void GLAPIENTRY
+static void GLAPIENTRY
_mesa_GetColorTableParameterfv( GLenum target, GLenum pname, GLfloat *params )
{
GET_CURRENT_CONTEXT(ctx);
-void GLAPIENTRY
+static void GLAPIENTRY
_mesa_GetColorTableParameteriv( GLenum target, GLenum pname, GLint *params )
{
GET_CURRENT_CONTEXT(ctx);
}
}
+
+void
+_mesa_init_colortable_dispatch(struct _glapi_table *disp)
+{
+ SET_ColorSubTable(disp, _mesa_ColorSubTable);
+ SET_ColorTable(disp, _mesa_ColorTable);
+ SET_ColorTableParameterfv(disp, _mesa_ColorTableParameterfv);
+ SET_ColorTableParameteriv(disp, _mesa_ColorTableParameteriv);
+ SET_CopyColorSubTable(disp, _mesa_CopyColorSubTable);
+ SET_CopyColorTable(disp, _mesa_CopyColorTable);
+ SET_GetColorTable(disp, _mesa_GetColorTable);
+ SET_GetColorTableParameterfv(disp, _mesa_GetColorTableParameterfv);
+ SET_GetColorTableParameteriv(disp, _mesa_GetColorTableParameteriv);
+}
+
+
+#endif /* FEATURE_colortable */
+
+
/**********************************************************************/
/***** Initialization *****/
/**********************************************************************/
#define COLORTAB_H
-#include "mtypes.h"
+#include "main/mtypes.h"
-#if _HAVE_FULL_GL
+#if FEATURE_colortable
+
+#define _MESA_INIT_COLORTABLE_FUNCTIONS(driver, impl) \
+ do { \
+ (driver)->CopyColorTable = impl ## CopyColorTable; \
+ (driver)->CopyColorSubTable = impl ## CopyColorSubTable; \
+ (driver)->UpdateTexturePalette = impl ## UpdateTexturePalette; \
+ } while (0)
extern void GLAPIENTRY
_mesa_ColorTable( GLenum target, GLenum internalformat,
GLsizei count, GLenum format, GLenum type,
const GLvoid *table );
-extern void GLAPIENTRY
-_mesa_CopyColorSubTable(GLenum target, GLsizei start,
- GLint x, GLint y, GLsizei width);
-
-extern void GLAPIENTRY
-_mesa_CopyColorTable(GLenum target, GLenum internalformat,
- GLint x, GLint y, GLsizei width);
+extern void
+_mesa_init_colortable_dispatch(struct _glapi_table *disp);
-extern void GLAPIENTRY
-_mesa_GetColorTable( GLenum target, GLenum format,
- GLenum type, GLvoid *table );
+#else /* FEATURE_colortable */
-extern void GLAPIENTRY
-_mesa_ColorTableParameterfv(GLenum target, GLenum pname,
- const GLfloat *params);
+#define _MESA_INIT_COLORTABLE_FUNCTIONS(driver, impl) do { } while (0)
-extern void GLAPIENTRY
-_mesa_ColorTableParameteriv(GLenum target, GLenum pname,
- const GLint *params);
+static INLINE void GLAPIENTRY
+_mesa_ColorTable( GLenum target, GLenum internalformat,
+ GLsizei width, GLenum format, GLenum type,
+ const GLvoid *table )
+{
+ ASSERT_NO_FEATURE();
+}
-extern void GLAPIENTRY
-_mesa_GetColorTableParameterfv( GLenum target, GLenum pname, GLfloat *params );
+static INLINE void GLAPIENTRY
+_mesa_ColorSubTable( GLenum target, GLsizei start,
+ GLsizei count, GLenum format, GLenum type,
+ const GLvoid *table )
+{
+ ASSERT_NO_FEATURE();
+}
-extern void GLAPIENTRY
-_mesa_GetColorTableParameteriv( GLenum target, GLenum pname, GLint *params );
+static INLINE void
+_mesa_init_colortable_dispatch(struct _glapi_table *disp)
+{
+}
+#endif /* FEATURE_colortable */
extern void
extern void
_mesa_free_colortables_data( GLcontext *ctx );
-#else
-
-/** No-op */
-#define _mesa_init_colortable( p ) ((void) 0)
-
-/** No-op */
-#define _mesa_free_colortable_data( p ) ((void) 0)
-
-/** No-op */
-#define _mesa_init_colortables( p ) ((void)0)
-
-/** No-op */
-#define _mesa_free_colortables_data( p ) ((void)0)
-
-#endif
-#endif
+#endif /* COLORTAB_H */
#include "blend.h"
#include "buffers.h"
#include "bufferobj.h"
-#if FEATURE_colortable
#include "colortab.h"
-#endif
#include "context.h"
#include "cpuinfo.h"
#include "debug.h"
#endif
_mesa_init_buffer_objects( ctx );
_mesa_init_color( ctx );
-#if FEATURE_colortable
_mesa_init_colortables( ctx );
-#endif
_mesa_init_current( ctx );
_mesa_init_depth( ctx );
_mesa_init_debug( ctx );
_mesa_free_texture_data( ctx );
_mesa_free_matrix_data( ctx );
_mesa_free_viewport_data( ctx );
-#if FEATURE_colortable
_mesa_free_colortables_data( ctx );
-#endif
_mesa_free_program_data(ctx);
_mesa_free_shader_state(ctx);
#if FEATURE_ARB_occlusion_query
#include "mfeatures.h"
-#if FEATURE_colortable
#include "colortab.h"
-#endif
#include "context.h"
#include "enums.h"
#include "fbobject.h"
*/
texObj->Target = 0x99;
-#if FEATURE_colortable
_mesa_free_colortable_data(&texObj->Palette);
-#endif
/* free the texture images */
for (face = 0; face < 6; face++) {
#include "glheader.h"
#include "mfeatures.h"
#include "colormac.h"
-#if FEATURE_colortable
#include "colortab.h"
-#endif
#include "context.h"
#include "enums.h"
#include "macros.h"
ctx->Texture.CurrentUnit = 0; /* multitexture */
ctx->Texture._EnabledUnits = 0x0;
ctx->Texture.SharedPalette = GL_FALSE;
-#if FEATURE_colortable
_mesa_init_colortable(&ctx->Texture.Palette);
-#endif
for (u = 0; u < MAX_TEXTURE_UNITS; u++)
init_texture_unit(ctx, u);
for (tgt = 0; tgt < NUM_TEXTURE_TARGETS; tgt++)
ctx->Driver.DeleteTexture(ctx, ctx->Texture.ProxyTex[tgt]);
-#if FEATURE_colortable
for (u = 0; u < MAX_TEXTURE_IMAGE_UNITS; u++)
_mesa_free_colortable_data(&ctx->Texture.Unit[u].ColorTable);
-#endif
}