/*
* Mesa 3-D graphics library
- * Version: 5.1
+ * Version: 6.0
*
- * Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2004 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"),
#include "glheader.h"
#include "imports.h"
+#include "api_arrayelt.h"
#include "api_loopback.h"
#include "config.h"
#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
#include "arbprogram.h"
+#include "program.h"
#endif
#include "attrib.h"
#include "blend.h"
#include "buffers.h"
+#if FEATURE_ARB_vertex_buffer_object
+#include "bufferobj.h"
+#endif
#include "clip.h"
#include "colormac.h"
#include "colortab.h"
#include "varray.h"
#if FEATURE_NV_vertex_program || FEATURE_NV_fragment_program
#include "nvprogram.h"
+#include "program.h"
#endif
#include "math/m_matrix.h"
#include "math/m_xform.h"
-
/**
- * Functions which aren't compiled but executed immediately:
- * - glIsList
- * - glGenLists
- * - glDeleteLists
- * - glEndList --- BUT: call ctx->Driver.EndList at end of list execution?
- * - glFeedbackBuffer
- * - glSelectBuffer
- * - glRenderMode
- * - glReadPixels
- * - glPixelStore
- * - glFlush
- * - glFinish
- * - glIsEnabled
- * - glGet*
- *
- * Functions which cause errors if called while compiling a display list:
- * - glNewList
+ * Flush vertices.
+ *
+ * \param ctx GL context.
+ *
+ * Checks if dd_function_table::SaveNeedFlush is marked to flush
+ * stored (save) vertices, and calls
+ * dd_function_table::SaveFlushVertices if so.
*/
+#define SAVE_FLUSH_VERTICES(ctx) \
+do { \
+ if (ctx->Driver.SaveNeedFlush) \
+ ctx->Driver.SaveFlushVertices(ctx); \
+} while (0)
+/**
+ * Macro to assert that the API call was made outside the
+ * glBegin()/glEnd() pair, with return value.
+ *
+ * \param ctx GL context.
+ * \param retval value to return value in case the assertion fails.
+ */
+#define ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval) \
+do { \
+ if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON || \
+ ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \
+ _mesa_compile_error( ctx, GL_INVALID_OPERATION, "begin/end" ); \
+ return retval; \
+ } \
+} while (0)
/**
- * Display list instructions are stored as sequences of "nodes". Nodes
- * are allocated in blocks. Each block has BLOCK_SIZE nodes. Blocks
- * are linked together with a pointer.
+ * Macro to assert that the API call was made outside the
+ * glBegin()/glEnd() pair.
+ *
+ * \param ctx GL context.
*/
+#define ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx) \
+do { \
+ if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON || \
+ ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \
+ _mesa_compile_error( ctx, GL_INVALID_OPERATION, "begin/end" ); \
+ return; \
+ } \
+} while (0)
+/**
+ * Macro to assert that the API call was made outside the
+ * glBegin()/glEnd() pair and flush the vertices.
+ *
+ * \param ctx GL context.
+ */
+#define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx) \
+do { \
+ ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx); \
+ SAVE_FLUSH_VERTICES(ctx); \
+} while (0)
/**
- * How many nodes to allocate at a time.
+ * Macro to assert that the API call was made outside the
+ * glBegin()/glEnd() pair and flush the vertices, with return value.
*
- * \note Reduced now that we hold vertices etc. elsewhere.
+ * \param ctx GL context.
+ * \param retval value to return value in case the assertion fails.
*/
-#define BLOCK_SIZE 256
+#define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, retval)\
+do { \
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval); \
+ SAVE_FLUSH_VERTICES(ctx); \
+} while (0)
+
/**
OPCODE_BITMAP,
OPCODE_BLEND_COLOR,
OPCODE_BLEND_EQUATION,
- OPCODE_BLEND_FUNC,
OPCODE_BLEND_FUNC_SEPARATE,
OPCODE_CALL_LIST,
OPCODE_CALL_LIST_OFFSET,
OPCODE_ACTIVE_STENCIL_FACE_EXT,
/* GL_EXT_depth_bounds_test */
OPCODE_DEPTH_BOUNDS_EXT,
+ /* GL_ARB_vertex/fragment_program */
+ OPCODE_PROGRAM_STRING_ARB,
+ OPCODE_PROGRAM_ENV_PARAMETER_ARB,
+
+
+ /* Vertex attributes -- fallback for when optimized display
+ * list build isn't active.
+ */
+ OPCODE_ATTR_1F,
+ OPCODE_ATTR_2F,
+ OPCODE_ATTR_3F,
+ OPCODE_ATTR_4F,
+ OPCODE_MATERIAL,
+ OPCODE_INDEX,
+ OPCODE_EDGEFLAG,
+ OPCODE_BEGIN,
+ OPCODE_END,
+ OPCODE_RECTF,
+ OPCODE_EVAL_C1,
+ OPCODE_EVAL_C2,
+ OPCODE_EVAL_P1,
+ OPCODE_EVAL_P2,
+
+
/* The following three are meta instructions */
OPCODE_ERROR, /* raise compiled-in error */
OPCODE_CONTINUE,
} OpCode;
+
/**
* Display list node.
*
+ * Display list instructions are stored as sequences of "nodes". Nodes
+ * are allocated in blocks. Each block has BLOCK_SIZE nodes. Blocks
+ * are linked together with a pointer.
+ *
* Each instruction in the display list is stored as a sequence of
* contiguous nodes in memory.
* Each node is the union of a variety of data types.
/**
- * Number of nodes of storage needed for each instruction.
+ * How many nodes to allocate at a time.
+ *
+ * \note Reduced now that we hold vertices etc. elsewhere.
+ */
+#define BLOCK_SIZE 256
+
+
+
+/**
+ * Number of nodes of storage needed for each instruction.
* Sizes for dynamically allocated opcodes are stored in the context struct.
*/
static GLuint InstSize[ OPCODE_END_OF_LIST+1 ];
break;
#if FEATURE_NV_vertex_program
case OPCODE_LOAD_PROGRAM_NV:
- FREE(n[4].data);
+ FREE(n[4].data); /* program string */
n += InstSize[n[0].opcode];
break;
case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV:
- FREE(n[2].data);
+ FREE(n[2].data); /* array of program ids */
n += InstSize[n[0].opcode];
break;
#endif
#if FEATURE_NV_fragment_program
case OPCODE_PROGRAM_NAMED_PARAMETER_NV:
- FREE(n[3].data);
+ FREE(n[3].data); /* parameter name */
+ n += InstSize[n[0].opcode];
+ break;
+#endif
+#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
+ case OPCODE_PROGRAM_STRING_ARB:
+ FREE(n[4].data); /* program string */
n += InstSize[n[0].opcode];
break;
#endif
InstSize[OPCODE_BITMAP] = 8;
InstSize[OPCODE_BLEND_COLOR] = 5;
InstSize[OPCODE_BLEND_EQUATION] = 2;
- InstSize[OPCODE_BLEND_FUNC] = 3;
InstSize[OPCODE_BLEND_FUNC_SEPARATE] = 5;
InstSize[OPCODE_CALL_LIST] = 2;
InstSize[OPCODE_CALL_LIST_OFFSET] = 3;
InstSize[OPCODE_ACTIVE_STENCIL_FACE_EXT] = 2;
/* GL_EXT_depth_bounds_test */
InstSize[OPCODE_DEPTH_BOUNDS_EXT] = 3;
+#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
+ InstSize[OPCODE_PROGRAM_STRING_ARB] = 5;
+ InstSize[OPCODE_PROGRAM_ENV_PARAMETER_ARB] = 7;
+#endif
+ InstSize[OPCODE_ATTR_1F] = 3;
+ InstSize[OPCODE_ATTR_2F] = 4;
+ InstSize[OPCODE_ATTR_3F] = 5;
+ InstSize[OPCODE_ATTR_4F] = 6;
+ InstSize[OPCODE_MATERIAL] = 7;
+ InstSize[OPCODE_INDEX] = 2;
+ InstSize[OPCODE_EDGEFLAG] = 2;
+ InstSize[OPCODE_BEGIN] = 2;
+ InstSize[OPCODE_END] = 1;
+ InstSize[OPCODE_RECTF] = 5;
+ InstSize[OPCODE_EVAL_C1] = 2;
+ InstSize[OPCODE_EVAL_C2] = 3;
+ InstSize[OPCODE_EVAL_P1] = 2;
+ InstSize[OPCODE_EVAL_P2] = 3;
}
init_flag = 1;
}
}
#endif
- if (ctx->CurrentPos + count + 2 > BLOCK_SIZE) {
+ if (ctx->ListState.CurrentPos + count + 2 > BLOCK_SIZE) {
/* This block is full. Allocate a new block and chain to it */
- n = ctx->CurrentBlock + ctx->CurrentPos;
+ n = ctx->ListState.CurrentBlock + ctx->ListState.CurrentPos;
n[0].opcode = OPCODE_CONTINUE;
newblock = (Node *) MALLOC( sizeof(Node) * BLOCK_SIZE );
if (!newblock) {
return NULL;
}
n[1].next = (Node *) newblock;
- ctx->CurrentBlock = newblock;
- ctx->CurrentPos = 0;
+ ctx->ListState.CurrentBlock = newblock;
+ ctx->ListState.CurrentPos = 0;
}
- n = ctx->CurrentBlock + ctx->CurrentPos;
- ctx->CurrentPos += count;
+ n = ctx->ListState.CurrentBlock + ctx->ListState.CurrentPos;
+ ctx->ListState.CurrentPos += count;
n[0].opcode = (OpCode) opcode;
/*
* Display List compilation functions
*/
-static void save_Accum( GLenum op, GLfloat value )
+static void GLAPIENTRY save_Accum( GLenum op, GLfloat value )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
}
-static void save_AlphaFunc( GLenum func, GLclampf ref )
+static void GLAPIENTRY save_AlphaFunc( GLenum func, GLclampf ref )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
}
-static void save_BindTexture( GLenum target, GLuint texture )
+static void GLAPIENTRY save_BindTexture( GLenum target, GLuint texture )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
}
-static void save_Bitmap( GLsizei width, GLsizei height,
+static void GLAPIENTRY save_Bitmap( GLsizei width, GLsizei height,
GLfloat xorig, GLfloat yorig,
GLfloat xmove, GLfloat ymove,
const GLubyte *pixels )
}
-static void save_BlendEquation( GLenum mode )
+static void GLAPIENTRY save_BlendEquation( GLenum mode )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
}
-static void save_BlendFunc( GLenum sfactor, GLenum dfactor )
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_BLEND_FUNC, 2 );
- if (n) {
- n[1].e = sfactor;
- n[2].e = dfactor;
- }
- if (ctx->ExecuteFlag) {
- (*ctx->Exec->BlendFunc)( sfactor, dfactor );
- }
-}
-
-
-static void save_BlendFuncSeparateEXT(GLenum sfactorRGB, GLenum dfactorRGB,
+static void GLAPIENTRY save_BlendFuncSeparateEXT(GLenum sfactorRGB, GLenum dfactorRGB,
GLenum sfactorA, GLenum dfactorA)
{
GET_CURRENT_CONTEXT(ctx);
}
-static void save_BlendColor( GLfloat red, GLfloat green,
+static void GLAPIENTRY save_BlendColor( GLfloat red, GLfloat green,
GLfloat blue, GLfloat alpha )
{
GET_CURRENT_CONTEXT(ctx);
}
-void _mesa_save_CallList( GLuint list )
+void GLAPIENTRY _mesa_save_CallList( GLuint list )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- FLUSH_CURRENT(ctx, 0);
+ SAVE_FLUSH_VERTICES(ctx);
n = ALLOC_INSTRUCTION( ctx, OPCODE_CALL_LIST, 1 );
if (n) {
n[1].ui = list;
}
+
+ /* After this, we don't know what begin/end state we're in:
+ */
+ ctx->Driver.CurrentSavePrimitive = PRIM_UNKNOWN;
+
if (ctx->ExecuteFlag) {
(*ctx->Exec->CallList)( list );
}
}
-void _mesa_save_CallLists( GLsizei n, GLenum type, const GLvoid *lists )
+void GLAPIENTRY _mesa_save_CallLists( GLsizei n, GLenum type, const GLvoid *lists )
{
GET_CURRENT_CONTEXT(ctx);
GLint i;
GLboolean typeErrorFlag;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- FLUSH_CURRENT(ctx, 0);
+ SAVE_FLUSH_VERTICES(ctx);
switch (type) {
case GL_BYTE:
n[2].b = typeErrorFlag;
}
}
+
+ /* After this, we don't know what begin/end state we're in:
+ */
+ ctx->Driver.CurrentSavePrimitive = PRIM_UNKNOWN;
+
if (ctx->ExecuteFlag) {
(*ctx->Exec->CallLists)( n, type, lists );
}
}
-static void save_Clear( GLbitfield mask )
+static void GLAPIENTRY save_Clear( GLbitfield mask )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
}
-static void save_ClearAccum( GLfloat red, GLfloat green,
+static void GLAPIENTRY save_ClearAccum( GLfloat red, GLfloat green,
GLfloat blue, GLfloat alpha )
{
GET_CURRENT_CONTEXT(ctx);
}
-static void save_ClearColor( GLclampf red, GLclampf green,
+static void GLAPIENTRY save_ClearColor( GLclampf red, GLclampf green,
GLclampf blue, GLclampf alpha )
{
GET_CURRENT_CONTEXT(ctx);
}
-static void save_ClearDepth( GLclampd depth )
+static void GLAPIENTRY save_ClearDepth( GLclampd depth )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
}
-static void save_ClearIndex( GLfloat c )
+static void GLAPIENTRY save_ClearIndex( GLfloat c )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
}
-static void save_ClearStencil( GLint s )
+static void GLAPIENTRY save_ClearStencil( GLint s )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
}
-static void save_ClipPlane( GLenum plane, const GLdouble *equ )
+static void GLAPIENTRY save_ClipPlane( GLenum plane, const GLdouble *equ )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
-static void save_ColorMask( GLboolean red, GLboolean green,
+static void GLAPIENTRY save_ColorMask( GLboolean red, GLboolean green,
GLboolean blue, GLboolean alpha )
{
GET_CURRENT_CONTEXT(ctx);
}
-static void save_ColorMaterial( GLenum face, GLenum mode )
+static void GLAPIENTRY save_ColorMaterial( GLenum face, GLenum mode )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- FLUSH_CURRENT(ctx, 0);
n = ALLOC_INSTRUCTION( ctx, OPCODE_COLOR_MATERIAL, 2 );
if (n) {
}
-static void save_ColorTable( GLenum target, GLenum internalFormat,
+static void GLAPIENTRY save_ColorTable( GLenum target, GLenum internalFormat,
GLsizei width, GLenum format, GLenum type,
const GLvoid *table )
{
-static void
+static void GLAPIENTRY
save_ColorTableParameterfv(GLenum target, GLenum pname, const GLfloat *params)
{
GET_CURRENT_CONTEXT(ctx);
}
-static void
+static void GLAPIENTRY
save_ColorTableParameteriv(GLenum target, GLenum pname, const GLint *params)
{
GET_CURRENT_CONTEXT(ctx);
-static void save_ColorSubTable( GLenum target, GLsizei start, GLsizei count,
+static void GLAPIENTRY save_ColorSubTable( GLenum target, GLsizei start, GLsizei count,
GLenum format, GLenum type,
const GLvoid *table)
{
}
-static void
+static void GLAPIENTRY
save_CopyColorSubTable(GLenum target, GLsizei start,
GLint x, GLint y, GLsizei width)
{
}
-static void
+static void GLAPIENTRY
save_CopyColorTable(GLenum target, GLenum internalformat,
GLint x, GLint y, GLsizei width)
{
}
-static void
+static void GLAPIENTRY
save_ConvolutionFilter1D(GLenum target, GLenum internalFormat, GLsizei width,
GLenum format, GLenum type, const GLvoid *filter)
{
}
-static void
+static void GLAPIENTRY
save_ConvolutionFilter2D(GLenum target, GLenum internalFormat,
GLsizei width, GLsizei height, GLenum format,
GLenum type, const GLvoid *filter)
}
-static void
+static void GLAPIENTRY
save_ConvolutionParameteri(GLenum target, GLenum pname, GLint param)
{
GET_CURRENT_CONTEXT(ctx);
}
-static void
+static void GLAPIENTRY
save_ConvolutionParameteriv(GLenum target, GLenum pname, const GLint *params)
{
GET_CURRENT_CONTEXT(ctx);
}
-static void
+static void GLAPIENTRY
save_ConvolutionParameterf(GLenum target, GLenum pname, GLfloat param)
{
GET_CURRENT_CONTEXT(ctx);
}
-static void
+static void GLAPIENTRY
save_ConvolutionParameterfv(GLenum target, GLenum pname, const GLfloat *params)
{
GET_CURRENT_CONTEXT(ctx);
}
-static void
+static void GLAPIENTRY
save_CopyPixels( GLint x, GLint y,
GLsizei width, GLsizei height, GLenum type )
{
-static void
+static void GLAPIENTRY
save_CopyTexImage1D( GLenum target, GLint level, GLenum internalformat,
GLint x, GLint y, GLsizei width, GLint border )
{
}
-static void
+static void GLAPIENTRY
save_CopyTexImage2D( GLenum target, GLint level,
GLenum internalformat,
GLint x, GLint y, GLsizei width,
-static void
+static void GLAPIENTRY
save_CopyTexSubImage1D( GLenum target, GLint level,
GLint xoffset, GLint x, GLint y,
GLsizei width )
}
-static void
+static void GLAPIENTRY
save_CopyTexSubImage2D( GLenum target, GLint level,
GLint xoffset, GLint yoffset,
GLint x, GLint y,
}
-static void
+static void GLAPIENTRY
save_CopyTexSubImage3D( GLenum target, GLint level,
GLint xoffset, GLint yoffset, GLint zoffset,
GLint x, GLint y,
}
-static void save_CullFace( GLenum mode )
+static void GLAPIENTRY save_CullFace( GLenum mode )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
}
-static void save_DepthFunc( GLenum func )
+static void GLAPIENTRY save_DepthFunc( GLenum func )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
}
-static void save_DepthMask( GLboolean mask )
+static void GLAPIENTRY save_DepthMask( GLboolean mask )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
}
-static void save_DepthRange( GLclampd nearval, GLclampd farval )
+static void GLAPIENTRY save_DepthRange( GLclampd nearval, GLclampd farval )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
}
-static void save_Disable( GLenum cap )
+static void GLAPIENTRY save_Disable( GLenum cap )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
}
-static void save_DrawBuffer( GLenum mode )
+static void GLAPIENTRY save_DrawBuffer( GLenum mode )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
}
-static void save_DrawPixels( GLsizei width, GLsizei height,
+static void GLAPIENTRY save_DrawPixels( GLsizei width, GLsizei height,
GLenum format, GLenum type,
const GLvoid *pixels )
{
-static void save_Enable( GLenum cap )
+static void GLAPIENTRY save_Enable( GLenum cap )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
-void _mesa_save_EvalMesh1( GLenum mode, GLint i1, GLint i2 )
+void GLAPIENTRY _mesa_save_EvalMesh1( GLenum mode, GLint i1, GLint i2 )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
}
-void _mesa_save_EvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 )
+void GLAPIENTRY _mesa_save_EvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
-static void save_Fogfv( GLenum pname, const GLfloat *params )
+static void GLAPIENTRY save_Fogfv( GLenum pname, const GLfloat *params )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
}
-static void save_Fogf( GLenum pname, GLfloat param )
+static void GLAPIENTRY save_Fogf( GLenum pname, GLfloat param )
{
save_Fogfv(pname, ¶m);
}
-static void save_Fogiv(GLenum pname, const GLint *params )
+static void GLAPIENTRY save_Fogiv(GLenum pname, const GLint *params )
{
GLfloat p[4];
switch (pname) {
}
-static void save_Fogi(GLenum pname, GLint param )
+static void GLAPIENTRY save_Fogi(GLenum pname, GLint param )
{
save_Fogiv(pname, ¶m);
}
-static void save_FrontFace( GLenum mode )
+static void GLAPIENTRY save_FrontFace( GLenum mode )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
}
-static void save_Frustum( GLdouble left, GLdouble right,
+static void GLAPIENTRY save_Frustum( GLdouble left, GLdouble right,
GLdouble bottom, GLdouble top,
GLdouble nearval, GLdouble farval )
{
}
-static void save_Hint( GLenum target, GLenum mode )
+static void GLAPIENTRY save_Hint( GLenum target, GLenum mode )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
}
-static void
+static void GLAPIENTRY
save_Histogram(GLenum target, GLsizei width, GLenum internalFormat, GLboolean sink)
{
GET_CURRENT_CONTEXT(ctx);
}
-static void save_IndexMask( GLuint mask )
+static void GLAPIENTRY save_IndexMask( GLuint mask )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
}
-static void save_InitNames( void )
+static void GLAPIENTRY save_InitNames( void )
{
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
}
-static void save_Lightfv( GLenum light, GLenum pname, const GLfloat *params )
+static void GLAPIENTRY save_Lightfv( GLenum light, GLenum pname, const GLfloat *params )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
}
-static void save_Lightf( GLenum light, GLenum pname, GLfloat params )
+static void GLAPIENTRY save_Lightf( GLenum light, GLenum pname, GLfloat params )
{
save_Lightfv(light, pname, ¶ms);
}
-static void save_Lightiv( GLenum light, GLenum pname, const GLint *params )
+static void GLAPIENTRY save_Lightiv( GLenum light, GLenum pname, const GLint *params )
{
GLfloat fparam[4];
switch (pname) {
}
-static void save_Lighti( GLenum light, GLenum pname, GLint param )
+static void GLAPIENTRY save_Lighti( GLenum light, GLenum pname, GLint param )
{
save_Lightiv( light, pname, ¶m );
}
-static void save_LightModelfv( GLenum pname, const GLfloat *params )
+static void GLAPIENTRY save_LightModelfv( GLenum pname, const GLfloat *params )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
}
-static void save_LightModelf( GLenum pname, GLfloat param )
+static void GLAPIENTRY save_LightModelf( GLenum pname, GLfloat param )
{
save_LightModelfv(pname, ¶m);
}
-static void save_LightModeliv( GLenum pname, const GLint *params )
+static void GLAPIENTRY save_LightModeliv( GLenum pname, const GLint *params )
{
GLfloat fparam[4];
switch (pname) {
}
-static void save_LightModeli( GLenum pname, GLint param )
+static void GLAPIENTRY save_LightModeli( GLenum pname, GLint param )
{
save_LightModeliv(pname, ¶m);
}
-static void save_LineStipple( GLint factor, GLushort pattern )
+static void GLAPIENTRY save_LineStipple( GLint factor, GLushort pattern )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
}
-static void save_LineWidth( GLfloat width )
+static void GLAPIENTRY save_LineWidth( GLfloat width )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
}
-static void save_ListBase( GLuint base )
+static void GLAPIENTRY save_ListBase( GLuint base )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
}
-static void save_LoadIdentity( void )
+static void GLAPIENTRY save_LoadIdentity( void )
{
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
}
-static void save_LoadMatrixf( const GLfloat *m )
+static void GLAPIENTRY save_LoadMatrixf( const GLfloat *m )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
}
-static void save_LoadMatrixd( const GLdouble *m )
+static void GLAPIENTRY save_LoadMatrixd( const GLdouble *m )
{
GLfloat f[16];
GLint i;
}
-static void save_LoadName( GLuint name )
+static void GLAPIENTRY save_LoadName( GLuint name )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
}
-static void save_LogicOp( GLenum opcode )
+static void GLAPIENTRY save_LogicOp( GLenum opcode )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
}
-static void save_Map1d( GLenum target, GLdouble u1, GLdouble u2, GLint stride,
+static void GLAPIENTRY save_Map1d( GLenum target, GLdouble u1, GLdouble u2, GLint stride,
GLint order, const GLdouble *points)
{
GET_CURRENT_CONTEXT(ctx);
}
}
-static void save_Map1f( GLenum target, GLfloat u1, GLfloat u2, GLint stride,
+static void GLAPIENTRY save_Map1f( GLenum target, GLfloat u1, GLfloat u2, GLint stride,
GLint order, const GLfloat *points)
{
GET_CURRENT_CONTEXT(ctx);
}
-static void save_Map2d( GLenum target,
+static void GLAPIENTRY save_Map2d( GLenum target,
GLdouble u1, GLdouble u2, GLint ustride, GLint uorder,
GLdouble v1, GLdouble v2, GLint vstride, GLint vorder,
const GLdouble *points )
}
-static void save_Map2f( GLenum target,
+static void GLAPIENTRY save_Map2f( GLenum target,
GLfloat u1, GLfloat u2, GLint ustride, GLint uorder,
GLfloat v1, GLfloat v2, GLint vstride, GLint vorder,
const GLfloat *points )
}
-static void save_MapGrid1f( GLint un, GLfloat u1, GLfloat u2 )
+static void GLAPIENTRY save_MapGrid1f( GLint un, GLfloat u1, GLfloat u2 )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
}
-static void save_MapGrid1d( GLint un, GLdouble u1, GLdouble u2 )
+static void GLAPIENTRY save_MapGrid1d( GLint un, GLdouble u1, GLdouble u2 )
{
save_MapGrid1f(un, (GLfloat) u1, (GLfloat) u2);
}
-static void save_MapGrid2f( GLint un, GLfloat u1, GLfloat u2,
+static void GLAPIENTRY save_MapGrid2f( GLint un, GLfloat u1, GLfloat u2,
GLint vn, GLfloat v1, GLfloat v2 )
{
GET_CURRENT_CONTEXT(ctx);
-static void save_MapGrid2d( GLint un, GLdouble u1, GLdouble u2,
+static void GLAPIENTRY save_MapGrid2d( GLint un, GLdouble u1, GLdouble u2,
GLint vn, GLdouble v1, GLdouble v2 )
{
- save_MapGrid2f(un, (GLfloat) u1, (GLfloat) u2,
+ save_MapGrid2f(un, (GLfloat) u1, (GLfloat) u2,
vn, (GLfloat) v1, (GLfloat) v2);
}
-static void save_MatrixMode( GLenum mode )
+static void GLAPIENTRY save_MatrixMode( GLenum mode )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
}
-static void
+static void GLAPIENTRY
save_Minmax(GLenum target, GLenum internalFormat, GLboolean sink)
{
GET_CURRENT_CONTEXT(ctx);
}
-static void save_MultMatrixf( const GLfloat *m )
+static void GLAPIENTRY save_MultMatrixf( const GLfloat *m )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
}
-static void save_MultMatrixd( const GLdouble *m )
+static void GLAPIENTRY save_MultMatrixd( const GLdouble *m )
{
GLfloat f[16];
GLint i;
}
-static void save_NewList( GLuint list, GLenum mode )
+static void GLAPIENTRY save_NewList( GLuint list, GLenum mode )
{
GET_CURRENT_CONTEXT(ctx);
/* It's an error to call this function while building a display list */
-static void save_Ortho( GLdouble left, GLdouble right,
+static void GLAPIENTRY save_Ortho( GLdouble left, GLdouble right,
GLdouble bottom, GLdouble top,
GLdouble nearval, GLdouble farval )
{
}
-static void
+static void GLAPIENTRY
save_PixelMapfv( GLenum map, GLint mapsize, const GLfloat *values )
{
GET_CURRENT_CONTEXT(ctx);
}
-static void
+static void GLAPIENTRY
save_PixelMapuiv(GLenum map, GLint mapsize, const GLuint *values )
{
GLfloat fvalues[MAX_PIXEL_MAP_TABLE];
}
-static void
+static void GLAPIENTRY
save_PixelMapusv(GLenum map, GLint mapsize, const GLushort *values)
{
GLfloat fvalues[MAX_PIXEL_MAP_TABLE];
}
-static void
+static void GLAPIENTRY
save_PixelTransferf( GLenum pname, GLfloat param )
{
GET_CURRENT_CONTEXT(ctx);
}
-static void
+static void GLAPIENTRY
save_PixelTransferi( GLenum pname, GLint param )
{
save_PixelTransferf( pname, (GLfloat) param );
}
-static void
+static void GLAPIENTRY
save_PixelZoom( GLfloat xfactor, GLfloat yfactor )
{
GET_CURRENT_CONTEXT(ctx);
}
-static void
+static void GLAPIENTRY
save_PointParameterfvEXT( GLenum pname, const GLfloat *params )
{
GET_CURRENT_CONTEXT(ctx);
}
-static void save_PointParameterfEXT( GLenum pname, GLfloat param )
+static void GLAPIENTRY save_PointParameterfEXT( GLenum pname, GLfloat param )
{
save_PointParameterfvEXT(pname, ¶m);
}
-static void save_PointParameteriNV( GLenum pname, GLint param )
+static void GLAPIENTRY save_PointParameteriNV( GLenum pname, GLint param )
{
GLfloat p = (GLfloat) param;
save_PointParameterfvEXT(pname, &p);
}
-static void save_PointParameterivNV( GLenum pname, const GLint *param )
+static void GLAPIENTRY save_PointParameterivNV( GLenum pname, const GLint *param )
{
GLfloat p = (GLfloat) param[0];
save_PointParameterfvEXT(pname, &p);
}
-static void save_PointSize( GLfloat size )
+static void GLAPIENTRY save_PointSize( GLfloat size )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
}
-static void save_PolygonMode( GLenum face, GLenum mode )
+static void GLAPIENTRY save_PolygonMode( GLenum face, GLenum mode )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
/*
* Polygon stipple must have been upacked already!
*/
-static void save_PolygonStipple( const GLubyte *pattern )
+static void GLAPIENTRY save_PolygonStipple( const GLubyte *pattern )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
}
-static void save_PolygonOffset( GLfloat factor, GLfloat units )
+static void GLAPIENTRY save_PolygonOffset( GLfloat factor, GLfloat units )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
}
-static void save_PolygonOffsetEXT( GLfloat factor, GLfloat bias )
+static void GLAPIENTRY save_PolygonOffsetEXT( GLfloat factor, GLfloat bias )
{
GET_CURRENT_CONTEXT(ctx);
save_PolygonOffset(factor, ctx->DepthMaxF * bias);
}
-static void save_PopAttrib( void )
+static void GLAPIENTRY save_PopAttrib( void )
{
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
}
-static void save_PopMatrix( void )
+static void GLAPIENTRY save_PopMatrix( void )
{
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- FLUSH_CURRENT(ctx, 0);
(void) ALLOC_INSTRUCTION( ctx, OPCODE_POP_MATRIX, 0 );
if (ctx->ExecuteFlag) {
(*ctx->Exec->PopMatrix)();
}
-static void save_PopName( void )
+static void GLAPIENTRY save_PopName( void )
{
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
}
-static void save_PrioritizeTextures( GLsizei num, const GLuint *textures,
+static void GLAPIENTRY save_PrioritizeTextures( GLsizei num, const GLuint *textures,
const GLclampf *priorities )
{
GET_CURRENT_CONTEXT(ctx);
}
-static void save_PushAttrib( GLbitfield mask )
+static void GLAPIENTRY save_PushAttrib( GLbitfield mask )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- FLUSH_CURRENT(ctx, 0);
n = ALLOC_INSTRUCTION( ctx, OPCODE_PUSH_ATTRIB, 1 );
if (n) {
n[1].bf = mask;
}
-static void save_PushMatrix( void )
+static void GLAPIENTRY save_PushMatrix( void )
{
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
}
-static void save_PushName( GLuint name )
+static void GLAPIENTRY save_PushName( GLuint name )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
}
-static void save_RasterPos4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w )
+static void GLAPIENTRY save_RasterPos4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- FLUSH_CURRENT(ctx, 0);
n = ALLOC_INSTRUCTION( ctx, OPCODE_RASTER_POS, 4 );
if (n) {
n[1].f = x;
}
}
-static void save_RasterPos2d(GLdouble x, GLdouble y)
+static void GLAPIENTRY save_RasterPos2d(GLdouble x, GLdouble y)
{
save_RasterPos4f((GLfloat) x, (GLfloat) y, 0.0F, 1.0F);
}
-static void save_RasterPos2f(GLfloat x, GLfloat y)
+static void GLAPIENTRY save_RasterPos2f(GLfloat x, GLfloat y)
{
save_RasterPos4f(x, y, 0.0F, 1.0F);
}
-static void save_RasterPos2i(GLint x, GLint y)
+static void GLAPIENTRY save_RasterPos2i(GLint x, GLint y)
{
save_RasterPos4f((GLfloat) x, (GLfloat) y, 0.0F, 1.0F);
}
-static void save_RasterPos2s(GLshort x, GLshort y)
+static void GLAPIENTRY save_RasterPos2s(GLshort x, GLshort y)
{
save_RasterPos4f(x, y, 0.0F, 1.0F);
}
-static void save_RasterPos3d(GLdouble x, GLdouble y, GLdouble z)
+static void GLAPIENTRY save_RasterPos3d(GLdouble x, GLdouble y, GLdouble z)
{
save_RasterPos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F);
}
-static void save_RasterPos3f(GLfloat x, GLfloat y, GLfloat z)
+static void GLAPIENTRY save_RasterPos3f(GLfloat x, GLfloat y, GLfloat z)
{
save_RasterPos4f(x, y, z, 1.0F);
}
-static void save_RasterPos3i(GLint x, GLint y, GLint z)
+static void GLAPIENTRY save_RasterPos3i(GLint x, GLint y, GLint z)
{
save_RasterPos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F);
}
-static void save_RasterPos3s(GLshort x, GLshort y, GLshort z)
+static void GLAPIENTRY save_RasterPos3s(GLshort x, GLshort y, GLshort z)
{
save_RasterPos4f(x, y, z, 1.0F);
}
-static void save_RasterPos4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+static void GLAPIENTRY save_RasterPos4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
{
save_RasterPos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w);
}
-static void save_RasterPos4i(GLint x, GLint y, GLint z, GLint w)
+static void GLAPIENTRY save_RasterPos4i(GLint x, GLint y, GLint z, GLint w)
{
save_RasterPos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w);
}
-static void save_RasterPos4s(GLshort x, GLshort y, GLshort z, GLshort w)
+static void GLAPIENTRY save_RasterPos4s(GLshort x, GLshort y, GLshort z, GLshort w)
{
save_RasterPos4f(x, y, z, w);
}
-static void save_RasterPos2dv(const GLdouble *v)
+static void GLAPIENTRY save_RasterPos2dv(const GLdouble *v)
{
save_RasterPos4f((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F);
}
-static void save_RasterPos2fv(const GLfloat *v)
+static void GLAPIENTRY save_RasterPos2fv(const GLfloat *v)
{
save_RasterPos4f(v[0], v[1], 0.0F, 1.0F);
}
-static void save_RasterPos2iv(const GLint *v)
+static void GLAPIENTRY save_RasterPos2iv(const GLint *v)
{
save_RasterPos4f((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F);
}
-static void save_RasterPos2sv(const GLshort *v)
+static void GLAPIENTRY save_RasterPos2sv(const GLshort *v)
{
save_RasterPos4f(v[0], v[1], 0.0F, 1.0F);
}
-static void save_RasterPos3dv(const GLdouble *v)
+static void GLAPIENTRY save_RasterPos3dv(const GLdouble *v)
{
save_RasterPos4f((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F);
}
-static void save_RasterPos3fv(const GLfloat *v)
+static void GLAPIENTRY save_RasterPos3fv(const GLfloat *v)
{
save_RasterPos4f(v[0], v[1], v[2], 1.0F);
}
-static void save_RasterPos3iv(const GLint *v)
+static void GLAPIENTRY save_RasterPos3iv(const GLint *v)
{
save_RasterPos4f((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F);
}
-static void save_RasterPos3sv(const GLshort *v)
+static void GLAPIENTRY save_RasterPos3sv(const GLshort *v)
{
save_RasterPos4f(v[0], v[1], v[2], 1.0F);
}
-static void save_RasterPos4dv(const GLdouble *v)
+static void GLAPIENTRY save_RasterPos4dv(const GLdouble *v)
{
- save_RasterPos4f((GLfloat) v[0], (GLfloat) v[1],
+ save_RasterPos4f((GLfloat) v[0], (GLfloat) v[1],
(GLfloat) v[2], (GLfloat) v[3]);
}
-static void save_RasterPos4fv(const GLfloat *v)
+static void GLAPIENTRY save_RasterPos4fv(const GLfloat *v)
{
save_RasterPos4f(v[0], v[1], v[2], v[3]);
}
-static void save_RasterPos4iv(const GLint *v)
+static void GLAPIENTRY save_RasterPos4iv(const GLint *v)
{
- save_RasterPos4f((GLfloat) v[0], (GLfloat) v[1],
+ save_RasterPos4f((GLfloat) v[0], (GLfloat) v[1],
(GLfloat) v[2], (GLfloat) v[3]);
}
-static void save_RasterPos4sv(const GLshort *v)
+static void GLAPIENTRY save_RasterPos4sv(const GLshort *v)
{
save_RasterPos4f(v[0], v[1], v[2], v[3]);
}
-static void save_PassThrough( GLfloat token )
+static void GLAPIENTRY save_PassThrough( GLfloat token )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
}
-static void save_ReadBuffer( GLenum mode )
+static void GLAPIENTRY save_ReadBuffer( GLenum mode )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
}
-static void
+static void GLAPIENTRY
save_ResetHistogram(GLenum target)
{
GET_CURRENT_CONTEXT(ctx);
}
-static void
+static void GLAPIENTRY
save_ResetMinmax(GLenum target)
{
GET_CURRENT_CONTEXT(ctx);
}
-static void save_Rotatef( GLfloat angle, GLfloat x, GLfloat y, GLfloat z )
+static void GLAPIENTRY save_Rotatef( GLfloat angle, GLfloat x, GLfloat y, GLfloat z )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
}
-static void save_Rotated( GLdouble angle, GLdouble x, GLdouble y, GLdouble z )
+static void GLAPIENTRY save_Rotated( GLdouble angle, GLdouble x, GLdouble y, GLdouble z )
{
save_Rotatef((GLfloat) angle, (GLfloat) x, (GLfloat) y, (GLfloat) z);
}
-static void save_Scalef( GLfloat x, GLfloat y, GLfloat z )
+static void GLAPIENTRY save_Scalef( GLfloat x, GLfloat y, GLfloat z )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
}
-static void save_Scaled( GLdouble x, GLdouble y, GLdouble z )
+static void GLAPIENTRY save_Scaled( GLdouble x, GLdouble y, GLdouble z )
{
save_Scalef((GLfloat) x, (GLfloat) y, (GLfloat) z);
}
-static void save_Scissor( GLint x, GLint y, GLsizei width, GLsizei height )
+static void GLAPIENTRY save_Scissor( GLint x, GLint y, GLsizei width, GLsizei height )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
}
-static void save_ShadeModel( GLenum mode )
+static void GLAPIENTRY save_ShadeModel( GLenum mode )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
}
-static void save_StencilFunc( GLenum func, GLint ref, GLuint mask )
+static void GLAPIENTRY save_StencilFunc( GLenum func, GLint ref, GLuint mask )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
}
-static void save_StencilMask( GLuint mask )
+static void GLAPIENTRY save_StencilMask( GLuint mask )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
}
-static void save_StencilOp( GLenum fail, GLenum zfail, GLenum zpass )
+static void GLAPIENTRY save_StencilOp( GLenum fail, GLenum zfail, GLenum zpass )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
}
-static void save_TexEnvfv( GLenum target, GLenum pname, const GLfloat *params )
+static void GLAPIENTRY save_TexEnvfv( GLenum target, GLenum pname, const GLfloat *params )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
}
-static void save_TexEnvf( GLenum target, GLenum pname, GLfloat param )
+static void GLAPIENTRY save_TexEnvf( GLenum target, GLenum pname, GLfloat param )
{
save_TexEnvfv( target, pname, ¶m );
}
-static void save_TexEnvi( GLenum target, GLenum pname, GLint param )
+static void GLAPIENTRY save_TexEnvi( GLenum target, GLenum pname, GLint param )
{
GLfloat p[4];
p[0] = (GLfloat) param;
}
-static void save_TexEnviv( GLenum target, GLenum pname, const GLint *param )
+static void GLAPIENTRY save_TexEnviv( GLenum target, GLenum pname, const GLint *param )
{
GLfloat p[4];
p[0] = INT_TO_FLOAT( param[0] );
}
-static void save_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params )
+static void GLAPIENTRY save_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
}
-static void save_TexGeniv(GLenum coord, GLenum pname, const GLint *params )
+static void GLAPIENTRY save_TexGeniv(GLenum coord, GLenum pname, const GLint *params )
{
GLfloat p[4];
p[0] = (GLfloat) params[0];
}
-static void save_TexGend(GLenum coord, GLenum pname, GLdouble param )
+static void GLAPIENTRY save_TexGend(GLenum coord, GLenum pname, GLdouble param )
{
GLfloat p = (GLfloat) param;
save_TexGenfv( coord, pname, &p );
}
-static void save_TexGendv(GLenum coord, GLenum pname, const GLdouble *params )
+static void GLAPIENTRY save_TexGendv(GLenum coord, GLenum pname, const GLdouble *params )
{
GLfloat p[4];
p[0] = (GLfloat) params[0];
}
-static void save_TexGenf( GLenum coord, GLenum pname, GLfloat param )
+static void GLAPIENTRY save_TexGenf( GLenum coord, GLenum pname, GLfloat param )
{
save_TexGenfv(coord, pname, ¶m);
}
-static void save_TexGeni( GLenum coord, GLenum pname, GLint param )
+static void GLAPIENTRY save_TexGeni( GLenum coord, GLenum pname, GLint param )
{
save_TexGeniv( coord, pname, ¶m );
}
-static void save_TexParameterfv( GLenum target,
+static void GLAPIENTRY save_TexParameterfv( GLenum target,
GLenum pname, const GLfloat *params )
{
GET_CURRENT_CONTEXT(ctx);
}
-static void save_TexParameterf( GLenum target, GLenum pname, GLfloat param )
+static void GLAPIENTRY save_TexParameterf( GLenum target, GLenum pname, GLfloat param )
{
save_TexParameterfv(target, pname, ¶m);
}
-static void save_TexParameteri( GLenum target, GLenum pname, GLint param )
+static void GLAPIENTRY save_TexParameteri( GLenum target, GLenum pname, GLint param )
{
GLfloat fparam[4];
fparam[0] = (GLfloat) param;
}
-static void save_TexParameteriv( GLenum target, GLenum pname, const GLint *params )
+static void GLAPIENTRY save_TexParameteriv( GLenum target, GLenum pname, const GLint *params )
{
GLfloat fparam[4];
fparam[0] = (GLfloat) params[0];
}
-static void save_TexImage1D( GLenum target,
+static void GLAPIENTRY save_TexImage1D( GLenum target,
GLint level, GLint components,
GLsizei width, GLint border,
GLenum format, GLenum type,
}
-static void save_TexImage2D( GLenum target,
+static void GLAPIENTRY save_TexImage2D( GLenum target,
GLint level, GLint components,
GLsizei width, GLsizei height, GLint border,
GLenum format, GLenum type,
}
-static void save_TexImage3D( GLenum target,
+static void GLAPIENTRY save_TexImage3D( GLenum target,
GLint level, GLint internalFormat,
GLsizei width, GLsizei height, GLsizei depth,
GLint border,
}
-static void save_TexSubImage1D( GLenum target, GLint level, GLint xoffset,
+static void GLAPIENTRY save_TexSubImage1D( GLenum target, GLint level, GLint xoffset,
GLsizei width, GLenum format, GLenum type,
const GLvoid *pixels )
{
}
-static void save_TexSubImage2D( GLenum target, GLint level,
+static void GLAPIENTRY save_TexSubImage2D( GLenum target, GLint level,
GLint xoffset, GLint yoffset,
GLsizei width, GLsizei height,
GLenum format, GLenum type,
}
-static void save_TexSubImage3D( GLenum target, GLint level,
+static void GLAPIENTRY save_TexSubImage3D( GLenum target, GLint level,
GLint xoffset, GLint yoffset,GLint zoffset,
GLsizei width, GLsizei height, GLsizei depth,
GLenum format, GLenum type,
}
-static void save_Translatef( GLfloat x, GLfloat y, GLfloat z )
+static void GLAPIENTRY save_Translatef( GLfloat x, GLfloat y, GLfloat z )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
}
-static void save_Translated( GLdouble x, GLdouble y, GLdouble z )
+static void GLAPIENTRY save_Translated( GLdouble x, GLdouble y, GLdouble z )
{
save_Translatef((GLfloat) x, (GLfloat) y, (GLfloat) z);
}
-static void save_Viewport( GLint x, GLint y, GLsizei width, GLsizei height )
+static void GLAPIENTRY save_Viewport( GLint x, GLint y, GLsizei width, GLsizei height )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
}
-static void save_WindowPos4fMESA( GLfloat x, GLfloat y, GLfloat z, GLfloat w )
+static void GLAPIENTRY save_WindowPos4fMESA( GLfloat x, GLfloat y, GLfloat z, GLfloat w )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- FLUSH_CURRENT(ctx, 0);
n = ALLOC_INSTRUCTION( ctx, OPCODE_WINDOW_POS, 4 );
if (n) {
n[1].f = x;
}
}
-static void save_WindowPos2dMESA(GLdouble x, GLdouble y)
+static void GLAPIENTRY save_WindowPos2dMESA(GLdouble x, GLdouble y)
{
save_WindowPos4fMESA((GLfloat) x, (GLfloat) y, 0.0F, 1.0F);
}
-static void save_WindowPos2fMESA(GLfloat x, GLfloat y)
+static void GLAPIENTRY save_WindowPos2fMESA(GLfloat x, GLfloat y)
{
save_WindowPos4fMESA(x, y, 0.0F, 1.0F);
}
-static void save_WindowPos2iMESA(GLint x, GLint y)
+static void GLAPIENTRY save_WindowPos2iMESA(GLint x, GLint y)
{
save_WindowPos4fMESA((GLfloat) x, (GLfloat) y, 0.0F, 1.0F);
}
-static void save_WindowPos2sMESA(GLshort x, GLshort y)
+static void GLAPIENTRY save_WindowPos2sMESA(GLshort x, GLshort y)
{
save_WindowPos4fMESA(x, y, 0.0F, 1.0F);
}
-static void save_WindowPos3dMESA(GLdouble x, GLdouble y, GLdouble z)
+static void GLAPIENTRY save_WindowPos3dMESA(GLdouble x, GLdouble y, GLdouble z)
{
save_WindowPos4fMESA((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F);
}
-static void save_WindowPos3fMESA(GLfloat x, GLfloat y, GLfloat z)
+static void GLAPIENTRY save_WindowPos3fMESA(GLfloat x, GLfloat y, GLfloat z)
{
save_WindowPos4fMESA(x, y, z, 1.0F);
}
-static void save_WindowPos3iMESA(GLint x, GLint y, GLint z)
+static void GLAPIENTRY save_WindowPos3iMESA(GLint x, GLint y, GLint z)
{
save_WindowPos4fMESA((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F);
}
-static void save_WindowPos3sMESA(GLshort x, GLshort y, GLshort z)
+static void GLAPIENTRY save_WindowPos3sMESA(GLshort x, GLshort y, GLshort z)
{
save_WindowPos4fMESA(x, y, z, 1.0F);
}
-static void save_WindowPos4dMESA(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+static void GLAPIENTRY save_WindowPos4dMESA(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
{
save_WindowPos4fMESA((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w);
}
-static void save_WindowPos4iMESA(GLint x, GLint y, GLint z, GLint w)
+static void GLAPIENTRY save_WindowPos4iMESA(GLint x, GLint y, GLint z, GLint w)
{
save_WindowPos4fMESA((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w);
}
-static void save_WindowPos4sMESA(GLshort x, GLshort y, GLshort z, GLshort w)
+static void GLAPIENTRY save_WindowPos4sMESA(GLshort x, GLshort y, GLshort z, GLshort w)
{
save_WindowPos4fMESA(x, y, z, w);
}
-static void save_WindowPos2dvMESA(const GLdouble *v)
+static void GLAPIENTRY save_WindowPos2dvMESA(const GLdouble *v)
{
save_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F);
}
-static void save_WindowPos2fvMESA(const GLfloat *v)
+static void GLAPIENTRY save_WindowPos2fvMESA(const GLfloat *v)
{
save_WindowPos4fMESA(v[0], v[1], 0.0F, 1.0F);
}
-static void save_WindowPos2ivMESA(const GLint *v)
+static void GLAPIENTRY save_WindowPos2ivMESA(const GLint *v)
{
save_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F);
}
-static void save_WindowPos2svMESA(const GLshort *v)
+static void GLAPIENTRY save_WindowPos2svMESA(const GLshort *v)
{
save_WindowPos4fMESA(v[0], v[1], 0.0F, 1.0F);
}
-static void save_WindowPos3dvMESA(const GLdouble *v)
+static void GLAPIENTRY save_WindowPos3dvMESA(const GLdouble *v)
{
save_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F);
}
-static void save_WindowPos3fvMESA(const GLfloat *v)
+static void GLAPIENTRY save_WindowPos3fvMESA(const GLfloat *v)
{
save_WindowPos4fMESA(v[0], v[1], v[2], 1.0F);
}
-static void save_WindowPos3ivMESA(const GLint *v)
+static void GLAPIENTRY save_WindowPos3ivMESA(const GLint *v)
{
save_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F);
}
-static void save_WindowPos3svMESA(const GLshort *v)
+static void GLAPIENTRY save_WindowPos3svMESA(const GLshort *v)
{
save_WindowPos4fMESA(v[0], v[1], v[2], 1.0F);
}
-static void save_WindowPos4dvMESA(const GLdouble *v)
+static void GLAPIENTRY save_WindowPos4dvMESA(const GLdouble *v)
{
- save_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1],
+ save_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1],
(GLfloat) v[2], (GLfloat) v[3]);
}
-static void save_WindowPos4fvMESA(const GLfloat *v)
+static void GLAPIENTRY save_WindowPos4fvMESA(const GLfloat *v)
{
save_WindowPos4fMESA(v[0], v[1], v[2], v[3]);
}
-static void save_WindowPos4ivMESA(const GLint *v)
+static void GLAPIENTRY save_WindowPos4ivMESA(const GLint *v)
{
- save_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1],
+ save_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1],
(GLfloat) v[2], (GLfloat) v[3]);
}
-static void save_WindowPos4svMESA(const GLshort *v)
+static void GLAPIENTRY save_WindowPos4svMESA(const GLshort *v)
{
save_WindowPos4fMESA(v[0], v[1], v[2], v[3]);
}
/* GL_ARB_multitexture */
-static void save_ActiveTextureARB( GLenum target )
+static void GLAPIENTRY save_ActiveTextureARB( GLenum target )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
/* GL_ARB_transpose_matrix */
-static void save_LoadTransposeMatrixdARB( const GLdouble m[16] )
+static void GLAPIENTRY save_LoadTransposeMatrixdARB( const GLdouble m[16] )
{
GLfloat tm[16];
_math_transposefd(tm, m);
}
-static void save_LoadTransposeMatrixfARB( const GLfloat m[16] )
+static void GLAPIENTRY save_LoadTransposeMatrixfARB( const GLfloat m[16] )
{
GLfloat tm[16];
_math_transposef(tm, m);
}
-static void
+static void GLAPIENTRY
save_MultTransposeMatrixdARB( const GLdouble m[16] )
{
GLfloat tm[16];
}
-static void
+static void GLAPIENTRY
save_MultTransposeMatrixfARB( const GLfloat m[16] )
{
GLfloat tm[16];
}
-static void
+static void GLAPIENTRY
save_PixelTexGenSGIX(GLenum mode)
{
GET_CURRENT_CONTEXT(ctx);
/* GL_ARB_texture_compression */
-static void
+static void GLAPIENTRY
save_CompressedTexImage1DARB(GLenum target, GLint level,
GLenum internalFormat, GLsizei width,
GLint border, GLsizei imageSize,
}
-static void
+static void GLAPIENTRY
save_CompressedTexImage2DARB(GLenum target, GLint level,
GLenum internalFormat, GLsizei width,
GLsizei height, GLint border, GLsizei imageSize,
}
-static void
+static void GLAPIENTRY
save_CompressedTexImage3DARB(GLenum target, GLint level,
GLenum internalFormat, GLsizei width,
GLsizei height, GLsizei depth, GLint border,
}
-static void
+static void GLAPIENTRY
save_CompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset,
GLsizei width, GLenum format,
GLsizei imageSize, const GLvoid *data)
}
-static void
+static void GLAPIENTRY
save_CompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset,
GLint yoffset, GLsizei width, GLsizei height,
GLenum format, GLsizei imageSize,
}
-static void
+static void GLAPIENTRY
save_CompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset,
GLint yoffset, GLint zoffset, GLsizei width,
GLsizei height, GLsizei depth, GLenum format,
/* GL_ARB_multisample */
-static void
+static void GLAPIENTRY
save_SampleCoverageARB(GLclampf value, GLboolean invert)
{
GET_CURRENT_CONTEXT(ctx);
/* GL_SGIS_pixel_texture */
-static void
+static void GLAPIENTRY
save_PixelTexGenParameteriSGIS(GLenum target, GLint value)
{
GET_CURRENT_CONTEXT(ctx);
}
-static void
+static void GLAPIENTRY
save_PixelTexGenParameterfSGIS(GLenum target, GLfloat value)
{
save_PixelTexGenParameteriSGIS(target, (GLint) value);
}
-static void
+static void GLAPIENTRY
save_PixelTexGenParameterivSGIS(GLenum target, const GLint *value)
{
save_PixelTexGenParameteriSGIS(target, *value);
}
-static void
+static void GLAPIENTRY
save_PixelTexGenParameterfvSGIS(GLenum target, const GLfloat *value)
{
save_PixelTexGenParameteriSGIS(target, (GLint) *value);
* GL_NV_vertex_program
*/
#if FEATURE_NV_vertex_program
-static void
+static void GLAPIENTRY
save_BindProgramNV(GLenum target, GLuint id)
{
GET_CURRENT_CONTEXT(ctx);
}
}
-static void
+static void GLAPIENTRY
save_ExecuteProgramNV(GLenum target, GLuint id, const GLfloat *params)
{
GET_CURRENT_CONTEXT(ctx);
}
-static void
+static void GLAPIENTRY
save_ProgramParameter4fNV(GLenum target, GLuint index,
GLfloat x, GLfloat y,
GLfloat z, GLfloat w)
}
-static void
+static void GLAPIENTRY
save_ProgramParameter4fvNV(GLenum target, GLuint index, const GLfloat *params)
{
save_ProgramParameter4fNV(target, index, params[0], params[1],
}
-static void
+static void GLAPIENTRY
save_ProgramParameter4dNV(GLenum target, GLuint index,
GLdouble x, GLdouble y,
GLdouble z, GLdouble w)
}
-static void
+static void GLAPIENTRY
save_ProgramParameter4dvNV(GLenum target, GLuint index,
const GLdouble *params)
{
}
-static void
+static void GLAPIENTRY
save_ProgramParameters4dvNV(GLenum target, GLuint index,
GLuint num, const GLdouble *params)
{
}
-static void
+static void GLAPIENTRY
save_ProgramParameters4fvNV(GLenum target, GLuint index,
GLuint num, const GLfloat *params)
{
}
-static void
+static void GLAPIENTRY
save_LoadProgramNV(GLenum target, GLuint id, GLsizei len,
const GLubyte *program)
{
}
-static void
+static void GLAPIENTRY
save_RequestResidentProgramsNV(GLsizei num, const GLuint *ids)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
- GLuint *idCopy;
- idCopy = _mesa_malloc(num * sizeof(GLuint));
+ GLuint *idCopy = (GLuint *) _mesa_malloc(num * sizeof(GLuint));
if (!idCopy) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glRequestResidentProgramsNV");
return;
}
-static void
+static void GLAPIENTRY
save_TrackMatrixNV(GLenum target, GLuint address,
GLenum matrix, GLenum transform)
{
* GL_NV_fragment_program
*/
#if FEATURE_NV_fragment_program
-static void
+static void GLAPIENTRY
save_ProgramLocalParameter4fARB(GLenum target, GLuint index,
GLfloat x, GLfloat y, GLfloat z, GLfloat w)
{
}
-static void
+static void GLAPIENTRY
save_ProgramLocalParameter4fvARB(GLenum target, GLuint index,
const GLfloat *params)
{
}
-static void
+static void GLAPIENTRY
save_ProgramLocalParameter4dARB(GLenum target, GLuint index,
GLdouble x, GLdouble y,
GLdouble z, GLdouble w)
}
-static void
+static void GLAPIENTRY
save_ProgramLocalParameter4dvARB(GLenum target, GLuint index,
const GLdouble *params)
{
}
}
-static void
+static void GLAPIENTRY
save_ProgramNamedParameter4fNV(GLuint id, GLsizei len, const GLubyte *name,
GLfloat x, GLfloat y, GLfloat z, GLfloat w)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
- GLubyte *nameCopy;
-
- nameCopy = _mesa_malloc(len);
+ GLubyte *nameCopy = (GLubyte *) _mesa_malloc(len);
if (!nameCopy) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glProgramNamedParameter4fNV");
return;
}
-static void
+static void GLAPIENTRY
save_ProgramNamedParameter4fvNV(GLuint id, GLsizei len, const GLubyte *name,
const float v[])
{
}
-static void
+static void GLAPIENTRY
save_ProgramNamedParameter4dNV(GLuint id, GLsizei len, const GLubyte *name,
GLdouble x, GLdouble y, GLdouble z, GLdouble w)
{
}
-static void
+static void GLAPIENTRY
save_ProgramNamedParameter4dvNV(GLuint id, GLsizei len, const GLubyte *name,
const double v[])
{
/* GL_EXT_stencil_two_side */
-static void save_ActiveStencilFaceEXT( GLenum face )
+static void GLAPIENTRY save_ActiveStencilFaceEXT( GLenum face )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
/* GL_EXT_depth_bounds_test */
-static void save_DepthBoundsEXT( GLclampd zmin, GLclampd zmax )
+static void GLAPIENTRY save_DepthBoundsEXT( GLclampd zmin, GLclampd zmax )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
+#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
+
+static void GLAPIENTRY
+save_ProgramStringARB(GLenum target, GLenum format, GLsizei len,
+ const GLvoid *string)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ GLubyte *programCopy;
+
+ programCopy = (GLubyte *) _mesa_malloc(len);
+ if (!programCopy) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glProgramStringARB");
+ return;
+ }
+ _mesa_memcpy(programCopy, string, len);
+
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = ALLOC_INSTRUCTION( ctx, OPCODE_PROGRAM_STRING_ARB, 4 );
+ if (n) {
+ n[1].e = target;
+ n[2].e = format;
+ n[3].i = len;
+ n[4].data = programCopy;
+ }
+ if (ctx->ExecuteFlag) {
+ (*ctx->Exec->ProgramStringARB)(target, format, len, string);
+ }
+}
+
+
+static void GLAPIENTRY
+save_ProgramEnvParameter4fARB(GLenum target, GLuint index,
+ GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = ALLOC_INSTRUCTION( ctx, OPCODE_PROGRAM_ENV_PARAMETER_ARB, 6 );
+ if (n) {
+ n[1].e = target;
+ n[2].ui = index;
+ n[3].f = x;
+ n[4].f = y;
+ n[5].f = z;
+ n[6].f = w;
+ }
+ if (ctx->ExecuteFlag) {
+ (*ctx->Exec->ProgramEnvParameter4fARB)( target, index, x, y, z, w);
+ }
+}
+
+
+static void GLAPIENTRY
+save_ProgramEnvParameter4fvARB(GLenum target, GLuint index,
+ const GLfloat *params)
+{
+ save_ProgramEnvParameter4fARB(target, index, params[0], params[1],
+ params[2], params[3]);
+}
+
+
+static void GLAPIENTRY
+save_ProgramEnvParameter4dARB(GLenum target, GLuint index,
+ GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+{
+ save_ProgramEnvParameter4fARB(target, index,
+ (GLfloat) x,
+ (GLfloat) y,
+ (GLfloat) z,
+ (GLfloat) w);
+}
+
+
+static void GLAPIENTRY
+save_ProgramEnvParameter4dvARB(GLenum target, GLuint index,
+ const GLdouble *params)
+{
+ save_ProgramEnvParameter4fARB(target, index,
+ (GLfloat) params[0],
+ (GLfloat) params[1],
+ (GLfloat) params[2],
+ (GLfloat) params[3]);
+}
+
+#endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program */
+
+
+
+
+static void save_Attr1f( GLenum attr, GLfloat x )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ SAVE_FLUSH_VERTICES( ctx );
+ n = ALLOC_INSTRUCTION( ctx, OPCODE_ATTR_1F, 2 );
+ if (n) {
+ n[1].e = attr;
+ n[2].f = x;
+ }
+
+ ctx->ListState.ActiveAttribSize[attr] = 1;
+ ASSIGN_4V( ctx->ListState.CurrentAttrib[attr], x, 0, 0, 1);
+
+ if (ctx->ExecuteFlag) {
+ (*ctx->Exec->VertexAttrib1fNV)( attr, x );
+ }
+}
+
+static void save_Attr2f( GLenum attr, GLfloat x, GLfloat y )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ SAVE_FLUSH_VERTICES( ctx );
+ n = ALLOC_INSTRUCTION( ctx, OPCODE_ATTR_2F, 3 );
+ if (n) {
+ n[1].e = attr;
+ n[2].f = x;
+ n[3].f = y;
+ }
+
+ ctx->ListState.ActiveAttribSize[attr] = 2;
+ ASSIGN_4V( ctx->ListState.CurrentAttrib[attr], x, y, 0, 1);
+
+ if (ctx->ExecuteFlag) {
+ (*ctx->Exec->VertexAttrib2fNV)( attr, x, y );
+ }
+}
+
+static void save_Attr3f( GLenum attr, GLfloat x, GLfloat y, GLfloat z )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ SAVE_FLUSH_VERTICES( ctx );
+ n = ALLOC_INSTRUCTION( ctx, OPCODE_ATTR_3F, 4 );
+ if (n) {
+ n[1].e = attr;
+ n[2].f = x;
+ n[3].f = y;
+ n[4].f = z;
+ }
+
+ ctx->ListState.ActiveAttribSize[attr] = 3;
+ ASSIGN_4V( ctx->ListState.CurrentAttrib[attr], x, y, z, 1);
+
+ if (ctx->ExecuteFlag) {
+ (*ctx->Exec->VertexAttrib3fNV)( attr, x, y, z );
+ }
+}
+
+static void save_Attr4f( GLenum attr, GLfloat x, GLfloat y, GLfloat z,
+ GLfloat w )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ SAVE_FLUSH_VERTICES( ctx );
+ n = ALLOC_INSTRUCTION( ctx, OPCODE_ATTR_4F, 5 );
+ if (n) {
+ n[1].e = attr;
+ n[2].f = x;
+ n[3].f = y;
+ n[4].f = z;
+ n[5].f = w;
+ }
+
+ ctx->ListState.ActiveAttribSize[attr] = 4;
+ ASSIGN_4V( ctx->ListState.CurrentAttrib[attr], x, y, z, w);
+
+ if (ctx->ExecuteFlag) {
+ (*ctx->Exec->VertexAttrib4fNV)( attr, x, y, z, w );
+ }
+}
+
+static void GLAPIENTRY save_EvalCoord1f( GLfloat x )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ SAVE_FLUSH_VERTICES( ctx );
+ n = ALLOC_INSTRUCTION( ctx, OPCODE_EVAL_C1, 1 );
+ if (n) {
+ n[1].f = x;
+ }
+ if (ctx->ExecuteFlag) {
+ (*ctx->Exec->EvalCoord1f)( x );
+ }
+}
+
+static void GLAPIENTRY save_EvalCoord1fv( const GLfloat *v )
+{
+ save_EvalCoord1f( v[0] );
+}
+
+static void GLAPIENTRY save_EvalCoord2f( GLfloat x, GLfloat y )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ SAVE_FLUSH_VERTICES( ctx );
+ n = ALLOC_INSTRUCTION( ctx, OPCODE_EVAL_C2, 2 );
+ if (n) {
+ n[1].f = x;
+ n[2].f = y;
+ }
+ if (ctx->ExecuteFlag) {
+ (*ctx->Exec->EvalCoord2f)( x, y );
+ }
+}
+
+static void GLAPIENTRY save_EvalCoord2fv( const GLfloat *v )
+{
+ save_EvalCoord2f( v[0], v[1] );
+}
+
+
+static void GLAPIENTRY save_EvalPoint1( GLint x )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ SAVE_FLUSH_VERTICES( ctx );
+ n = ALLOC_INSTRUCTION( ctx, OPCODE_EVAL_P1, 1 );
+ if (n) {
+ n[1].i = x;
+ }
+ if (ctx->ExecuteFlag) {
+ (*ctx->Exec->EvalPoint1)( x );
+ }
+}
+
+static void GLAPIENTRY save_EvalPoint2( GLint x, GLint y )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ SAVE_FLUSH_VERTICES( ctx );
+ n = ALLOC_INSTRUCTION( ctx, OPCODE_EVAL_P2, 2 );
+ if (n) {
+ n[1].i = x;
+ n[2].i = y;
+ }
+ if (ctx->ExecuteFlag) {
+ (*ctx->Exec->EvalPoint2)( x, y );
+ }
+}
+
+static void GLAPIENTRY save_Indexf( GLfloat x )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ SAVE_FLUSH_VERTICES( ctx );
+ n = ALLOC_INSTRUCTION( ctx, OPCODE_INDEX, 1 );
+ if (n) {
+ n[1].f = x;
+ }
+
+ ctx->ListState.ActiveIndex = 1;
+ ctx->ListState.CurrentIndex = x;
+
+ if (ctx->ExecuteFlag) {
+ (*ctx->Exec->Indexi)( (GLint) x );
+ }
+}
+
+static void GLAPIENTRY save_Indexfv( const GLfloat *v )
+{
+ save_Indexf( v[0] );
+}
+
+static void GLAPIENTRY save_EdgeFlag( GLboolean x )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ SAVE_FLUSH_VERTICES( ctx );
+ n = ALLOC_INSTRUCTION( ctx, OPCODE_EDGEFLAG, 1 );
+ if (n) {
+ n[1].b = x;
+ }
+
+ ctx->ListState.ActiveEdgeFlag = 1;
+ ctx->ListState.CurrentEdgeFlag = x;
+
+ if (ctx->ExecuteFlag) {
+ (*ctx->Exec->EdgeFlag)( x );
+ }
+}
+
+static void GLAPIENTRY save_EdgeFlagv( const GLboolean *v )
+{
+ save_EdgeFlag( v[0] );
+}
+
+static void GLAPIENTRY save_Materialfv( GLenum face, GLenum pname, const GLfloat *param )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ int args, i;
+
+ SAVE_FLUSH_VERTICES( ctx );
+
+ switch (face) {
+ case GL_BACK:
+ case GL_FRONT:
+ case GL_FRONT_AND_BACK:
+ break;
+ default:
+ _mesa_compile_error( ctx, GL_INVALID_ENUM, "material(face)" );
+ return;
+ }
+
+ switch (pname) {
+ case GL_EMISSION:
+ case GL_AMBIENT:
+ case GL_DIFFUSE:
+ case GL_SPECULAR:
+ case GL_AMBIENT_AND_DIFFUSE:
+ args = 4;
+ break;
+ case GL_SHININESS:
+ args = 1;
+ break;
+ case GL_COLOR_INDEXES:
+ args = 3;
+ break;
+ default:
+ _mesa_compile_error( ctx, GL_INVALID_ENUM, "material(pname)" );
+ return;
+ }
+
+ n = ALLOC_INSTRUCTION( ctx, OPCODE_MATERIAL, 6 );
+ if (n) {
+ n[1].e = face;
+ n[2].e = pname;
+ for (i = 0 ; i < args ; i++)
+ n[3+i].f = param[i];
+ }
+
+ {
+ GLuint bitmask = _mesa_material_bitmask( ctx, face, pname, ~0, 0 );
+ for (i = 0 ; i < MAT_ATTRIB_MAX ; i++)
+ if (bitmask & (1<<i)) {
+ ctx->ListState.ActiveMaterialSize[i] = args;
+ COPY_SZ_4V( ctx->ListState.CurrentMaterial[i], args, param );
+ }
+ }
+
+ if (ctx->ExecuteFlag) {
+ (*ctx->Exec->Materialfv)( face, pname, param );
+ }
+}
+
+static void GLAPIENTRY save_Begin( GLenum mode )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ GLboolean error = GL_FALSE;
+
+ if (mode < GL_POINTS || mode > GL_POLYGON) {
+ _mesa_compile_error( ctx, GL_INVALID_ENUM, "Begin (mode)");
+ error = GL_TRUE;
+ }
+ else if (ctx->Driver.CurrentSavePrimitive == PRIM_UNKNOWN) {
+ /* Typically the first begin. This may raise an error on
+ * playback, depending on whether CallList is issued from inside
+ * a begin/end or not.
+ */
+ ctx->Driver.CurrentSavePrimitive = PRIM_INSIDE_UNKNOWN_PRIM;
+ }
+ else if (ctx->Driver.CurrentSavePrimitive == PRIM_OUTSIDE_BEGIN_END) {
+ ctx->Driver.CurrentSavePrimitive = mode;
+ }
+ else {
+ _mesa_compile_error( ctx, GL_INVALID_OPERATION, "recursive begin" );
+ error = GL_TRUE;
+ }
+
+ if (!error) {
+ /* Give the driver an opportunity to hook in an optimized
+ * display list compiler.
+ */
+ if (ctx->Driver.NotifySaveBegin( ctx, mode ))
+ return;
+
+ SAVE_FLUSH_VERTICES( ctx );
+ n = ALLOC_INSTRUCTION( ctx, OPCODE_BEGIN, 1 );
+ if (n) {
+ n[1].e = mode;
+ }
+ }
+
+ if (ctx->ExecuteFlag) {
+ (*ctx->Exec->Begin)( mode );
+ }
+}
+
+static void GLAPIENTRY save_End( void )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ SAVE_FLUSH_VERTICES( ctx );
+ (void) ALLOC_INSTRUCTION( ctx, OPCODE_END, 0 );
+ ctx->Driver.CurrentSavePrimitive = PRIM_OUTSIDE_BEGIN_END;
+ if (ctx->ExecuteFlag) {
+ (*ctx->Exec->End)( );
+ }
+}
+
+static void GLAPIENTRY save_Rectf( GLfloat a, GLfloat b,
+ GLfloat c, GLfloat d )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ SAVE_FLUSH_VERTICES( ctx );
+ n = ALLOC_INSTRUCTION( ctx, OPCODE_RECTF, 4 );
+ if (n) {
+ n[1].f = a;
+ n[2].f = b;
+ n[3].f = c;
+ n[4].f = d;
+ }
+ if (ctx->ExecuteFlag) {
+ (*ctx->Exec->Rectf)( a, b, c, d );
+ }
+}
+
+/*
+ */
+static void GLAPIENTRY save_Vertex2f( GLfloat x, GLfloat y )
+{
+ save_Attr2f( VERT_ATTRIB_POS, x, y );
+}
+
+static void GLAPIENTRY save_Vertex2fv( const GLfloat *v )
+{
+ save_Attr2f( VERT_ATTRIB_POS, v[0], v[1] );
+}
+
+static void GLAPIENTRY save_Vertex3f( GLfloat x, GLfloat y, GLfloat z )
+{
+ save_Attr3f( VERT_ATTRIB_POS, x, y, z );
+}
+
+static void GLAPIENTRY save_Vertex3fv( const GLfloat *v )
+{
+ save_Attr3f( VERT_ATTRIB_POS, v[0], v[1], v[2] );
+}
+
+static void GLAPIENTRY save_Vertex4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w )
+{
+ save_Attr4f( VERT_ATTRIB_POS, x, y, z, w );
+}
+
+static void GLAPIENTRY save_Vertex4fv( const GLfloat *v )
+{
+ save_Attr4f( VERT_ATTRIB_POS, v[0], v[1], v[2], v[3] );
+}
+
+static void GLAPIENTRY save_TexCoord1f( GLfloat x )
+{
+ save_Attr1f( VERT_ATTRIB_TEX0, x );
+}
+
+static void GLAPIENTRY save_TexCoord1fv( const GLfloat *v )
+{
+ save_Attr1f( VERT_ATTRIB_TEX0, v[0] );
+}
+
+static void GLAPIENTRY save_TexCoord2f( GLfloat x, GLfloat y )
+{
+ save_Attr2f( VERT_ATTRIB_TEX0, x, y );
+}
+
+static void GLAPIENTRY save_TexCoord2fv( const GLfloat *v )
+{
+ save_Attr2f( VERT_ATTRIB_TEX0, v[0], v[1] );
+}
+
+static void GLAPIENTRY save_TexCoord3f( GLfloat x, GLfloat y, GLfloat z )
+{
+ save_Attr3f( VERT_ATTRIB_TEX0, x, y, z );
+}
+
+static void GLAPIENTRY save_TexCoord3fv( const GLfloat *v )
+{
+ save_Attr3f( VERT_ATTRIB_TEX0, v[0], v[1], v[2] );
+}
+
+static void GLAPIENTRY save_TexCoord4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w )
+{
+ save_Attr4f( VERT_ATTRIB_TEX0, x, y, z, w );
+}
+
+static void GLAPIENTRY save_TexCoord4fv( const GLfloat *v )
+{
+ save_Attr4f( VERT_ATTRIB_TEX0, v[0], v[1], v[2], v[3] );
+}
+
+static void GLAPIENTRY save_Normal3f( GLfloat x, GLfloat y, GLfloat z )
+{
+ save_Attr3f( VERT_ATTRIB_NORMAL, x, y, z );
+}
+
+static void GLAPIENTRY save_Normal3fv( const GLfloat *v )
+{
+ save_Attr3f( VERT_ATTRIB_NORMAL, v[0], v[1], v[2] );
+}
+
+static void GLAPIENTRY save_FogCoordfEXT( GLfloat x )
+{
+ save_Attr1f( VERT_ATTRIB_FOG, x );
+}
+
+static void GLAPIENTRY save_FogCoordfvEXT( const GLfloat *v )
+{
+ save_Attr1f( VERT_ATTRIB_FOG, v[0] );
+}
+
+static void GLAPIENTRY save_Color3f( GLfloat x, GLfloat y, GLfloat z )
+{
+ save_Attr3f( VERT_ATTRIB_COLOR0, x, y, z );
+}
+
+static void GLAPIENTRY save_Color3fv( const GLfloat *v )
+{
+ save_Attr3f( VERT_ATTRIB_COLOR0, v[0], v[1], v[2] );
+}
+
+static void GLAPIENTRY save_Color4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w )
+{
+ save_Attr4f( VERT_ATTRIB_COLOR0, x, y, z, w );
+}
+
+static void GLAPIENTRY save_Color4fv( const GLfloat *v )
+{
+ save_Attr4f( VERT_ATTRIB_COLOR0, v[0], v[1], v[2], v[3] );
+}
+
+static void GLAPIENTRY save_SecondaryColor3fEXT( GLfloat x, GLfloat y, GLfloat z )
+{
+ save_Attr3f( VERT_ATTRIB_COLOR1, x, y, z );
+}
+
+static void GLAPIENTRY save_SecondaryColor3fvEXT( const GLfloat *v )
+{
+ save_Attr3f( VERT_ATTRIB_COLOR1, v[0], v[1], v[2] );
+}
+
+
+/* Just call the respective ATTR for texcoord
+ */
+static void GLAPIENTRY save_MultiTexCoord1f( GLenum target, GLfloat x )
+{
+ GLuint attr = (target & 0x7) + VERT_ATTRIB_TEX0;
+ save_Attr1f( attr, x );
+}
+
+static void GLAPIENTRY save_MultiTexCoord1fv( GLenum target, const GLfloat *v )
+{
+ GLuint attr = (target & 0x7) + VERT_ATTRIB_TEX0;
+ save_Attr1f( attr, v[0] );
+}
+
+static void GLAPIENTRY save_MultiTexCoord2f( GLenum target, GLfloat x, GLfloat y )
+{
+ GLuint attr = (target & 0x7) + VERT_ATTRIB_TEX0;
+ save_Attr2f( attr, x, y );
+}
+
+static void GLAPIENTRY save_MultiTexCoord2fv( GLenum target, const GLfloat *v )
+{
+ GLuint attr = (target & 0x7) + VERT_ATTRIB_TEX0;
+ save_Attr2f( attr, v[0], v[1] );
+}
+
+static void GLAPIENTRY save_MultiTexCoord3f( GLenum target, GLfloat x, GLfloat y,
+ GLfloat z)
+{
+ GLuint attr = (target & 0x7) + VERT_ATTRIB_TEX0;
+ save_Attr3f( attr, x, y, z );
+}
+
+static void GLAPIENTRY save_MultiTexCoord3fv( GLenum target, const GLfloat *v )
+{
+ GLuint attr = (target & 0x7) + VERT_ATTRIB_TEX0;
+ save_Attr3f( attr, v[0], v[1], v[2] );
+}
+
+static void GLAPIENTRY save_MultiTexCoord4f( GLenum target, GLfloat x, GLfloat y,
+ GLfloat z, GLfloat w )
+{
+ GLuint attr = (target & 0x7) + VERT_ATTRIB_TEX0;
+ save_Attr4f( attr, x, y, z, w );
+}
+
+static void GLAPIENTRY save_MultiTexCoord4fv( GLenum target, const GLfloat *v )
+{
+ GLuint attr = (target & 0x7) + VERT_ATTRIB_TEX0;
+ save_Attr4f( attr, v[0], v[1], v[2], v[3] );
+}
+
+
+static void enum_error( void )
+{
+ GET_CURRENT_CONTEXT( ctx );
+ _mesa_error( ctx, GL_INVALID_ENUM, "VertexAttribfNV" );
+}
+
+/* First level for NV_vertex_program:
+ *
+ * Check for errors at compile time?.
+ */
+static void GLAPIENTRY save_VertexAttrib1fNV( GLuint index, GLfloat x )
+{
+ if (index < VERT_ATTRIB_MAX)
+ save_Attr1f( index, x );
+ else
+ enum_error();
+}
+
+static void GLAPIENTRY save_VertexAttrib1fvNV( GLuint index, const GLfloat *v )
+{
+ if (index < VERT_ATTRIB_MAX)
+ save_Attr1f( index, v[0] );
+ else
+ enum_error();
+}
+
+static void GLAPIENTRY save_VertexAttrib2fNV( GLuint index, GLfloat x, GLfloat y )
+{
+ if (index < VERT_ATTRIB_MAX)
+ save_Attr2f( index, x, y );
+ else
+ enum_error();
+}
+
+static void GLAPIENTRY save_VertexAttrib2fvNV( GLuint index, const GLfloat *v )
+{
+ if (index < VERT_ATTRIB_MAX)
+ save_Attr2f( index, v[0], v[1] );
+ else
+ enum_error();
+}
+
+static void GLAPIENTRY save_VertexAttrib3fNV( GLuint index, GLfloat x, GLfloat y,
+ GLfloat z )
+{
+ if (index < VERT_ATTRIB_MAX)
+ save_Attr3f( index, x, y, z );
+ else
+ enum_error();
+}
+
+static void GLAPIENTRY save_VertexAttrib3fvNV( GLuint index, const GLfloat *v )
+{
+ if (index < VERT_ATTRIB_MAX)
+ save_Attr3f( index, v[0], v[1], v[2] );
+ else
+ enum_error();
+}
+
+static void GLAPIENTRY save_VertexAttrib4fNV( GLuint index, GLfloat x, GLfloat y,
+ GLfloat z, GLfloat w )
+{
+ if (index < VERT_ATTRIB_MAX)
+ save_Attr4f( index, x, y, z, w );
+ else
+ enum_error();
+}
+
+static void GLAPIENTRY save_VertexAttrib4fvNV( GLuint index, const GLfloat *v )
+{
+ if (index < VERT_ATTRIB_MAX)
+ save_Attr4f( index, v[0], v[1], v[2], v[3] );
+ else
+ enum_error();
+}
+
+
+
+
/* KW: Compile commands
*
* the absolute list number, not relative to ListBase.
* \param list - display list number
*/
-static void
+static void GLAPIENTRY
execute_list( GLcontext *ctx, GLuint list )
{
Node *n;
if (ctx->Driver.BeginCallList)
ctx->Driver.BeginCallList( ctx, list );
- ctx->CallDepth++;
+ ctx->ListState.CallDepth++;
n = (Node *) _mesa_HashLookup(ctx->Shared->DisplayList, list);
case OPCODE_BLEND_EQUATION:
(*ctx->Exec->BlendEquation)( n[1].e );
break;
- case OPCODE_BLEND_FUNC:
- (*ctx->Exec->BlendFunc)( n[1].e, n[2].e );
- break;
case OPCODE_BLEND_FUNC_SEPARATE:
(*ctx->Exec->BlendFuncSeparateEXT)(n[1].e, n[2].e, n[3].e, n[4].e);
break;
case OPCODE_CALL_LIST:
/* Generated by glCallList(), don't add ListBase */
- if (ctx->CallDepth<MAX_LIST_NESTING) {
+ if (ctx->ListState.CallDepth<MAX_LIST_NESTING) {
execute_list( ctx, n[1].ui );
}
break;
/* user specified a bad data type at compile time */
_mesa_error(ctx, GL_INVALID_ENUM, "glCallLists(type)");
}
- else if (ctx->CallDepth < MAX_LIST_NESTING) {
+ else if (ctx->ListState.CallDepth < MAX_LIST_NESTING) {
execute_list( ctx, ctx->List.ListBase + n[1].ui );
}
break;
}
break;
case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV:
- (*ctx->Exec->RequestResidentProgramsNV)(n[1].ui, n[2].data);
+ (*ctx->Exec->RequestResidentProgramsNV)(n[1].ui,
+ (GLuint *) n[2].data);
break;
case OPCODE_LOAD_PROGRAM_NV:
- (*ctx->Exec->LoadProgramNV)(n[1].e, n[2].ui, n[3].i, n[4].data);
+ (*ctx->Exec->LoadProgramNV)(n[1].e, n[2].ui, n[3].i,
+ (const GLubyte *) n[4].data);
break;
case OPCODE_PROGRAM_PARAMETER4F_NV:
(*ctx->Exec->ProgramParameter4fNV)(n[1].e, n[2].ui, n[3].f,
n[4].f, n[5].f, n[6].f);
break;
case OPCODE_PROGRAM_NAMED_PARAMETER_NV:
- (*ctx->Exec->ProgramNamedParameter4fNV)(n[1].ui, n[2].i, n[3].data,
+ (*ctx->Exec->ProgramNamedParameter4fNV)(n[1].ui, n[2].i,
+ (const GLubyte *) n[3].data,
n[4].f, n[5].f, n[6].f, n[7].f);
break;
#endif
case OPCODE_DEPTH_BOUNDS_EXT:
(*ctx->Exec->DepthBoundsEXT)(n[1].f, n[2].f);
break;
+#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
+ case OPCODE_PROGRAM_STRING_ARB:
+ (*ctx->Exec->ProgramStringARB)(n[1].e, n[2].e, n[3].i, n[4].data);
+ break;
+ case OPCODE_PROGRAM_ENV_PARAMETER_ARB:
+ (*ctx->Exec->ProgramEnvParameter4fARB)(n[1].e, n[2].ui, n[3].f,
+ n[4].f, n[5].f, n[6].f);
+ break;
+#endif
+
+ case OPCODE_ATTR_1F:
+ (*ctx->Exec->VertexAttrib1fNV)(n[1].e, n[2].f);
+ break;
+ case OPCODE_ATTR_2F:
+ (*ctx->Exec->VertexAttrib2fvNV)(n[1].e, &n[2].f);
+ break;
+ case OPCODE_ATTR_3F:
+ (*ctx->Exec->VertexAttrib3fvNV)(n[1].e, &n[2].f);
+ break;
+ case OPCODE_ATTR_4F:
+ (*ctx->Exec->VertexAttrib4fvNV)(n[1].e, &n[2].f);
+ break;
+ case OPCODE_MATERIAL:
+ (*ctx->Exec->Materialfv)(n[1].e, n[2].e, &n[3].f);
+ break;
+ case OPCODE_INDEX:
+ (*ctx->Exec->Indexi)(n[1].i);
+ break;
+ case OPCODE_EDGEFLAG:
+ (*ctx->Exec->EdgeFlag)(n[1].b);
+ break;
+ case OPCODE_BEGIN:
+ (*ctx->Exec->Begin)(n[1].e);
+ break;
+ case OPCODE_END:
+ (*ctx->Exec->End)();
+ break;
+ case OPCODE_RECTF:
+ (*ctx->Exec->Rectf)(n[1].f, n[2].f, n[3].f, n[4].f);
+ break;
+ case OPCODE_EVAL_C1:
+ (*ctx->Exec->EvalCoord1f)(n[1].f);
+ break;
+ case OPCODE_EVAL_C2:
+ (*ctx->Exec->EvalCoord2fv)(&n[1].f);
+ break;
+ case OPCODE_EVAL_P1:
+ (*ctx->Exec->EvalPoint1)(n[1].i);
+ break;
+ case OPCODE_EVAL_P2:
+ (*ctx->Exec->EvalPoint2)(n[1].i, n[2].i);
+ break;
+
+
+
case OPCODE_CONTINUE:
n = (Node *) n[1].next;
}
}
}
- ctx->CallDepth--;
+ ctx->ListState.CallDepth--;
if (ctx->Driver.EndCallList)
ctx->Driver.EndCallList( ctx );
/*
* Test if a display list number is valid.
*/
-GLboolean
+GLboolean GLAPIENTRY
_mesa_IsList( GLuint list )
{
GET_CURRENT_CONTEXT(ctx);
/*
* Delete a sequence of consecutive display lists.
*/
-void
+void GLAPIENTRY
_mesa_DeleteLists( GLuint list, GLsizei range )
{
GET_CURRENT_CONTEXT(ctx);
* Return a display list number, n, such that lists n through n+range-1
* are free.
*/
-GLuint
+GLuint GLAPIENTRY
_mesa_GenLists(GLsizei range )
{
GET_CURRENT_CONTEXT(ctx);
/*
* Begin a new display list.
*/
-void
+void GLAPIENTRY
_mesa_NewList( GLuint list, GLenum mode )
{
GET_CURRENT_CONTEXT(ctx);
+ GLint i;
+
FLUSH_CURRENT(ctx, 0); /* must be called before assert */
ASSERT_OUTSIDE_BEGIN_END(ctx);
return;
}
- if (ctx->CurrentListPtr) {
+ if (ctx->ListState.CurrentListPtr) {
/* already compiling a display list */
_mesa_error( ctx, GL_INVALID_OPERATION, "glNewList" );
return;
}
- /* Allocate new display list */
- ctx->CurrentListNum = list;
- ctx->CurrentBlock = (Node *) MALLOC( sizeof(Node) * BLOCK_SIZE );
- ctx->CurrentListPtr = ctx->CurrentBlock;
- ctx->CurrentPos = 0;
ctx->CompileFlag = GL_TRUE;
ctx->ExecuteFlag = (mode == GL_COMPILE_AND_EXECUTE);
+ /* Allocate new display list */
+ ctx->ListState.CurrentListNum = list;
+ ctx->ListState.CurrentBlock = (Node *) CALLOC( sizeof(Node) * BLOCK_SIZE );
+ ctx->ListState.CurrentListPtr = ctx->ListState.CurrentBlock;
+ ctx->ListState.CurrentPos = 0;
+
+ /* Reset acumulated list state:
+ */
+ for (i = 0; i < VERT_ATTRIB_MAX; i++)
+ ctx->ListState.ActiveAttribSize[i] = 0;
+
+ for (i = 0; i < MAT_ATTRIB_MAX; i++)
+ ctx->ListState.ActiveMaterialSize[i] = 0;
+
+ ctx->ListState.ActiveIndex = 0;
+ ctx->ListState.ActiveEdgeFlag = 0;
+
+ ctx->Driver.CurrentSavePrimitive = PRIM_UNKNOWN;
ctx->Driver.NewList( ctx, list, mode );
ctx->CurrentDispatch = ctx->Save;
/*
- * End definition of current display list. Is the current
- * ASSERT_OUTSIDE_BEGIN_END strong enough to really guarentee that
- * we are outside begin/end calls?
+ * End definition of current display list.
*/
-void
+void GLAPIENTRY
_mesa_EndList( void )
{
GET_CURRENT_CONTEXT(ctx);
- FLUSH_CURRENT(ctx, 0); /* must be called before assert */
+ SAVE_FLUSH_VERTICES(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
if (MESA_VERBOSE&VERBOSE_API)
_mesa_debug(ctx, "glEndList\n");
/* Check that a list is under construction */
- if (!ctx->CurrentListPtr) {
+ if (!ctx->ListState.CurrentListPtr) {
_mesa_error( ctx, GL_INVALID_OPERATION, "glEndList" );
return;
}
(void) ALLOC_INSTRUCTION( ctx, OPCODE_END_OF_LIST, 0 );
/* Destroy old list, if any */
- _mesa_destroy_list(ctx, ctx->CurrentListNum);
+ _mesa_destroy_list(ctx, ctx->ListState.CurrentListNum);
/* Install the list */
- _mesa_HashInsert(ctx->Shared->DisplayList, ctx->CurrentListNum, ctx->CurrentListPtr);
+ _mesa_HashInsert(ctx->Shared->DisplayList, ctx->ListState.CurrentListNum, ctx->ListState.CurrentListPtr);
if (MESA_VERBOSE & VERBOSE_DISPLAY_LIST)
- mesa_print_display_list(ctx->CurrentListNum);
+ mesa_print_display_list(ctx->ListState.CurrentListNum);
- ctx->CurrentListNum = 0;
- ctx->CurrentListPtr = NULL;
+ ctx->ListState.CurrentListNum = 0;
+ ctx->ListState.CurrentListPtr = NULL;
ctx->ExecuteFlag = GL_TRUE;
ctx->CompileFlag = GL_FALSE;
-void
+void GLAPIENTRY
_mesa_CallList( GLuint list )
{
GLboolean save_compile_flag;
/* execute the display list, and restore the CompileFlag. */
if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(ctx, "glCallList %d\n", list);
+ _mesa_debug(ctx, "glCallList %d\n", list);
if (list == 0) {
_mesa_error(ctx, GL_INVALID_VALUE, "glCallList(list==0)");
/*
* Execute glCallLists: call multiple display lists.
*/
-void
+void GLAPIENTRY
_mesa_CallLists( GLsizei n, GLenum type, const GLvoid *lists )
{
GET_CURRENT_CONTEXT(ctx);
GLboolean save_compile_flag;
if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(ctx, "glCallLists %d\n", n);
+ _mesa_debug(ctx, "glCallLists %d\n", n);
switch (type) {
case GL_BYTE:
/*
* Set the offset added to list numbers in glCallLists.
*/
-void
+void GLAPIENTRY
_mesa_ListBase( GLuint base )
{
GET_CURRENT_CONTEXT(ctx);
/* Can no longer assume ctx->Exec->Func is equal to _mesa_Func.
*/
-static void exec_Finish( void )
+static void GLAPIENTRY exec_Finish( void )
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
ctx->Exec->Finish();
}
-static void exec_Flush( void )
+static void GLAPIENTRY exec_Flush( void )
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
ctx->Exec->Flush( );
}
-static void exec_GetBooleanv( GLenum pname, GLboolean *params )
+static void GLAPIENTRY exec_GetBooleanv( GLenum pname, GLboolean *params )
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
ctx->Exec->GetBooleanv( pname, params );
}
-static void exec_GetClipPlane( GLenum plane, GLdouble *equation )
+static void GLAPIENTRY exec_GetClipPlane( GLenum plane, GLdouble *equation )
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
ctx->Exec->GetClipPlane( plane, equation );
}
-static void exec_GetDoublev( GLenum pname, GLdouble *params )
+static void GLAPIENTRY exec_GetDoublev( GLenum pname, GLdouble *params )
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
ctx->Exec->GetDoublev( pname, params );
}
-static GLenum exec_GetError( void )
+static GLenum GLAPIENTRY exec_GetError( void )
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
return ctx->Exec->GetError( );
}
-static void exec_GetFloatv( GLenum pname, GLfloat *params )
+static void GLAPIENTRY exec_GetFloatv( GLenum pname, GLfloat *params )
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
ctx->Exec->GetFloatv( pname, params );
}
-static void exec_GetIntegerv( GLenum pname, GLint *params )
+static void GLAPIENTRY exec_GetIntegerv( GLenum pname, GLint *params )
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
ctx->Exec->GetIntegerv( pname, params );
}
-static void exec_GetLightfv( GLenum light, GLenum pname, GLfloat *params )
+static void GLAPIENTRY exec_GetLightfv( GLenum light, GLenum pname, GLfloat *params )
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
ctx->Exec->GetLightfv( light, pname, params );
}
-static void exec_GetLightiv( GLenum light, GLenum pname, GLint *params )
+static void GLAPIENTRY exec_GetLightiv( GLenum light, GLenum pname, GLint *params )
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
ctx->Exec->GetLightiv( light, pname, params );
}
-static void exec_GetMapdv( GLenum target, GLenum query, GLdouble *v )
+static void GLAPIENTRY exec_GetMapdv( GLenum target, GLenum query, GLdouble *v )
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
ctx->Exec->GetMapdv( target, query, v );
}
-static void exec_GetMapfv( GLenum target, GLenum query, GLfloat *v )
+static void GLAPIENTRY exec_GetMapfv( GLenum target, GLenum query, GLfloat *v )
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
ctx->Exec->GetMapfv( target, query, v );
}
-static void exec_GetMapiv( GLenum target, GLenum query, GLint *v )
+static void GLAPIENTRY exec_GetMapiv( GLenum target, GLenum query, GLint *v )
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
ctx->Exec->GetMapiv( target, query, v );
}
-static void exec_GetMaterialfv( GLenum face, GLenum pname, GLfloat *params )
+static void GLAPIENTRY exec_GetMaterialfv( GLenum face, GLenum pname, GLfloat *params )
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
ctx->Exec->GetMaterialfv( face, pname, params );
}
-static void exec_GetMaterialiv( GLenum face, GLenum pname, GLint *params )
+static void GLAPIENTRY exec_GetMaterialiv( GLenum face, GLenum pname, GLint *params )
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
ctx->Exec->GetMaterialiv( face, pname, params );
}
-static void exec_GetPixelMapfv( GLenum map, GLfloat *values )
+static void GLAPIENTRY exec_GetPixelMapfv( GLenum map, GLfloat *values )
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
ctx->Exec->GetPixelMapfv( map, values );
}
-static void exec_GetPixelMapuiv( GLenum map, GLuint *values )
+static void GLAPIENTRY exec_GetPixelMapuiv( GLenum map, GLuint *values )
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
ctx->Exec->GetPixelMapuiv( map, values );
}
-static void exec_GetPixelMapusv( GLenum map, GLushort *values )
+static void GLAPIENTRY exec_GetPixelMapusv( GLenum map, GLushort *values )
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
ctx->Exec->GetPixelMapusv( map, values );
}
-static void exec_GetPolygonStipple( GLubyte *dest )
+static void GLAPIENTRY exec_GetPolygonStipple( GLubyte *dest )
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
ctx->Exec->GetPolygonStipple( dest );
}
-static const GLubyte *exec_GetString( GLenum name )
+static const GLubyte * GLAPIENTRY exec_GetString( GLenum name )
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
return ctx->Exec->GetString( name );
}
-static void exec_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params )
+static void GLAPIENTRY exec_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params )
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
ctx->Exec->GetTexEnvfv( target, pname, params );
}
-static void exec_GetTexEnviv( GLenum target, GLenum pname, GLint *params )
+static void GLAPIENTRY exec_GetTexEnviv( GLenum target, GLenum pname, GLint *params )
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
ctx->Exec->GetTexEnviv( target, pname, params );
}
-static void exec_GetTexGendv( GLenum coord, GLenum pname, GLdouble *params )
+static void GLAPIENTRY exec_GetTexGendv( GLenum coord, GLenum pname, GLdouble *params )
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
ctx->Exec->GetTexGendv( coord, pname, params );
}
-static void exec_GetTexGenfv( GLenum coord, GLenum pname, GLfloat *params )
+static void GLAPIENTRY exec_GetTexGenfv( GLenum coord, GLenum pname, GLfloat *params )
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
ctx->Exec->GetTexGenfv( coord, pname, params );
}
-static void exec_GetTexGeniv( GLenum coord, GLenum pname, GLint *params )
+static void GLAPIENTRY exec_GetTexGeniv( GLenum coord, GLenum pname, GLint *params )
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
ctx->Exec->GetTexGeniv( coord, pname, params );
}
-static void exec_GetTexImage( GLenum target, GLint level, GLenum format,
+static void GLAPIENTRY exec_GetTexImage( GLenum target, GLint level, GLenum format,
GLenum type, GLvoid *pixels )
{
GET_CURRENT_CONTEXT(ctx);
ctx->Exec->GetTexImage( target, level, format, type, pixels );
}
-static void exec_GetTexLevelParameterfv( GLenum target, GLint level,
+static void GLAPIENTRY exec_GetTexLevelParameterfv( GLenum target, GLint level,
GLenum pname, GLfloat *params )
{
GET_CURRENT_CONTEXT(ctx);
ctx->Exec->GetTexLevelParameterfv( target, level, pname, params );
}
-static void exec_GetTexLevelParameteriv( GLenum target, GLint level,
+static void GLAPIENTRY exec_GetTexLevelParameteriv( GLenum target, GLint level,
GLenum pname, GLint *params )
{
GET_CURRENT_CONTEXT(ctx);
ctx->Exec->GetTexLevelParameteriv( target, level, pname, params );
}
-static void exec_GetTexParameterfv( GLenum target, GLenum pname,
+static void GLAPIENTRY exec_GetTexParameterfv( GLenum target, GLenum pname,
GLfloat *params )
{
GET_CURRENT_CONTEXT(ctx);
ctx->Exec->GetTexParameterfv( target, pname, params );
}
-static void exec_GetTexParameteriv( GLenum target, GLenum pname, GLint *params )
+static void GLAPIENTRY exec_GetTexParameteriv( GLenum target, GLenum pname, GLint *params )
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
ctx->Exec->GetTexParameteriv( target, pname, params );
}
-static GLboolean exec_IsEnabled( GLenum cap )
+static GLboolean GLAPIENTRY exec_IsEnabled( GLenum cap )
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
return ctx->Exec->IsEnabled( cap );
}
-static void exec_PixelStoref( GLenum pname, GLfloat param )
+static void GLAPIENTRY exec_PixelStoref( GLenum pname, GLfloat param )
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
ctx->Exec->PixelStoref( pname, param );
}
-static void exec_PixelStorei( GLenum pname, GLint param )
+static void GLAPIENTRY exec_PixelStorei( GLenum pname, GLint param )
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
ctx->Exec->PixelStorei( pname, param );
}
-static void exec_ReadPixels( GLint x, GLint y, GLsizei width, GLsizei height,
+static void GLAPIENTRY exec_ReadPixels( GLint x, GLint y, GLsizei width, GLsizei height,
GLenum format, GLenum type, GLvoid *pixels )
{
GET_CURRENT_CONTEXT(ctx);
ctx->Exec->ReadPixels( x, y, width, height, format, type, pixels );
}
-static GLint exec_RenderMode( GLenum mode )
+static GLint GLAPIENTRY exec_RenderMode( GLenum mode )
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
return ctx->Exec->RenderMode( mode );
}
-static void exec_FeedbackBuffer( GLsizei size, GLenum type, GLfloat *buffer )
+static void GLAPIENTRY exec_FeedbackBuffer( GLsizei size, GLenum type, GLfloat *buffer )
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
ctx->Exec->FeedbackBuffer( size, type, buffer );
}
-static void exec_SelectBuffer( GLsizei size, GLuint *buffer )
+static void GLAPIENTRY exec_SelectBuffer( GLsizei size, GLuint *buffer )
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
ctx->Exec->SelectBuffer( size, buffer );
}
-static GLboolean exec_AreTexturesResident(GLsizei n, const GLuint *texName,
+static GLboolean GLAPIENTRY exec_AreTexturesResident(GLsizei n, const GLuint *texName,
GLboolean *residences)
{
GET_CURRENT_CONTEXT(ctx);
return ctx->Exec->AreTexturesResident( n, texName, residences);
}
-static void exec_ColorPointer(GLint size, GLenum type, GLsizei stride,
+static void GLAPIENTRY exec_ColorPointer(GLint size, GLenum type, GLsizei stride,
const GLvoid *ptr)
{
GET_CURRENT_CONTEXT(ctx);
ctx->Exec->ColorPointer( size, type, stride, ptr);
}
-static void exec_DeleteTextures( GLsizei n, const GLuint *texName)
+static void GLAPIENTRY exec_DeleteTextures( GLsizei n, const GLuint *texName)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
ctx->Exec->DeleteTextures( n, texName);
}
-static void exec_DisableClientState( GLenum cap )
+static void GLAPIENTRY exec_DisableClientState( GLenum cap )
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
ctx->Exec->DisableClientState( cap );
}
-static void exec_EdgeFlagPointer(GLsizei stride, const void *vptr)
+static void GLAPIENTRY exec_EdgeFlagPointer(GLsizei stride, const GLvoid *vptr)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
ctx->Exec->EdgeFlagPointer( stride, vptr);
}
-static void exec_EnableClientState( GLenum cap )
+static void GLAPIENTRY exec_EnableClientState( GLenum cap )
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
ctx->Exec->EnableClientState( cap );
}
-static void exec_GenTextures( GLsizei n, GLuint *texName )
+static void GLAPIENTRY exec_GenTextures( GLsizei n, GLuint *texName )
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
ctx->Exec->GenTextures( n, texName );
}
-static void exec_GetPointerv( GLenum pname, GLvoid **params )
+static void GLAPIENTRY exec_GetPointerv( GLenum pname, GLvoid **params )
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
ctx->Exec->GetPointerv( pname, params );
}
-static void exec_IndexPointer(GLenum type, GLsizei stride, const GLvoid *ptr)
+static void GLAPIENTRY exec_IndexPointer(GLenum type, GLsizei stride, const GLvoid *ptr)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
ctx->Exec->IndexPointer( type, stride, ptr);
}
-static void exec_InterleavedArrays(GLenum format, GLsizei stride,
+static void GLAPIENTRY exec_InterleavedArrays(GLenum format, GLsizei stride,
const GLvoid *pointer)
{
GET_CURRENT_CONTEXT(ctx);
ctx->Exec->InterleavedArrays( format, stride, pointer);
}
-static GLboolean exec_IsTexture( GLuint texture )
+static GLboolean GLAPIENTRY exec_IsTexture( GLuint texture )
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
return ctx->Exec->IsTexture( texture );
}
-static void exec_NormalPointer(GLenum type, GLsizei stride, const GLvoid *ptr )
+static void GLAPIENTRY exec_NormalPointer(GLenum type, GLsizei stride, const GLvoid *ptr )
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
ctx->Exec->NormalPointer( type, stride, ptr );
}
-static void exec_PopClientAttrib(void)
+static void GLAPIENTRY exec_PopClientAttrib(void)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
ctx->Exec->PopClientAttrib();
}
-static void exec_PushClientAttrib(GLbitfield mask)
+static void GLAPIENTRY exec_PushClientAttrib(GLbitfield mask)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
ctx->Exec->PushClientAttrib( mask);
}
-static void exec_TexCoordPointer(GLint size, GLenum type, GLsizei stride,
+static void GLAPIENTRY exec_TexCoordPointer(GLint size, GLenum type, GLsizei stride,
const GLvoid *ptr)
{
GET_CURRENT_CONTEXT(ctx);
ctx->Exec->TexCoordPointer( size, type, stride, ptr);
}
-static void exec_GetCompressedTexImageARB(GLenum target, GLint level,
+static void GLAPIENTRY exec_GetCompressedTexImageARB(GLenum target, GLint level,
GLvoid *img)
{
GET_CURRENT_CONTEXT(ctx);
ctx->Exec->GetCompressedTexImageARB( target, level, img);
}
-static void exec_VertexPointer(GLint size, GLenum type, GLsizei stride,
+static void GLAPIENTRY exec_VertexPointer(GLint size, GLenum type, GLsizei stride,
const GLvoid *ptr)
{
GET_CURRENT_CONTEXT(ctx);
ctx->Exec->VertexPointer( size, type, stride, ptr);
}
-static void exec_CopyConvolutionFilter1D(GLenum target, GLenum internalFormat,
+static void GLAPIENTRY exec_CopyConvolutionFilter1D(GLenum target, GLenum internalFormat,
GLint x, GLint y, GLsizei width)
{
GET_CURRENT_CONTEXT(ctx);
ctx->Exec->CopyConvolutionFilter1D( target, internalFormat, x, y, width);
}
-static void exec_CopyConvolutionFilter2D(GLenum target, GLenum internalFormat,
+static void GLAPIENTRY exec_CopyConvolutionFilter2D(GLenum target, GLenum internalFormat,
GLint x, GLint y, GLsizei width,
GLsizei height)
{
height);
}
-static void exec_GetColorTable( GLenum target, GLenum format,
+static void GLAPIENTRY exec_GetColorTable( GLenum target, GLenum format,
GLenum type, GLvoid *data )
{
GET_CURRENT_CONTEXT(ctx);
ctx->Exec->GetColorTable( target, format, type, data );
}
-static void exec_GetColorTableParameterfv( GLenum target, GLenum pname,
+static void GLAPIENTRY exec_GetColorTableParameterfv( GLenum target, GLenum pname,
GLfloat *params )
{
GET_CURRENT_CONTEXT(ctx);
ctx->Exec->GetColorTableParameterfv( target, pname, params );
}
-static void exec_GetColorTableParameteriv( GLenum target, GLenum pname,
+static void GLAPIENTRY exec_GetColorTableParameteriv( GLenum target, GLenum pname,
GLint *params )
{
GET_CURRENT_CONTEXT(ctx);
ctx->Exec->GetColorTableParameteriv( target, pname, params );
}
-static void exec_GetConvolutionFilter(GLenum target, GLenum format, GLenum type,
+static void GLAPIENTRY exec_GetConvolutionFilter(GLenum target, GLenum format, GLenum type,
GLvoid *image)
{
GET_CURRENT_CONTEXT(ctx);
ctx->Exec->GetConvolutionFilter( target, format, type, image);
}
-static void exec_GetConvolutionParameterfv(GLenum target, GLenum pname,
+static void GLAPIENTRY exec_GetConvolutionParameterfv(GLenum target, GLenum pname,
GLfloat *params)
{
GET_CURRENT_CONTEXT(ctx);
ctx->Exec->GetConvolutionParameterfv( target, pname, params);
}
-static void exec_GetConvolutionParameteriv(GLenum target, GLenum pname,
+static void GLAPIENTRY exec_GetConvolutionParameteriv(GLenum target, GLenum pname,
GLint *params)
{
GET_CURRENT_CONTEXT(ctx);
ctx->Exec->GetConvolutionParameteriv( target, pname, params);
}
-static void exec_GetHistogram(GLenum target, GLboolean reset, GLenum format,
+static void GLAPIENTRY exec_GetHistogram(GLenum target, GLboolean reset, GLenum format,
GLenum type, GLvoid *values)
{
GET_CURRENT_CONTEXT(ctx);
ctx->Exec->GetHistogram( target, reset, format, type, values);
}
-static void exec_GetHistogramParameterfv(GLenum target, GLenum pname,
+static void GLAPIENTRY exec_GetHistogramParameterfv(GLenum target, GLenum pname,
GLfloat *params)
{
GET_CURRENT_CONTEXT(ctx);
ctx->Exec->GetHistogramParameterfv( target, pname, params);
}
-static void exec_GetHistogramParameteriv(GLenum target, GLenum pname,
+static void GLAPIENTRY exec_GetHistogramParameteriv(GLenum target, GLenum pname,
GLint *params)
{
GET_CURRENT_CONTEXT(ctx);
ctx->Exec->GetHistogramParameteriv( target, pname, params);
}
-static void exec_GetMinmax(GLenum target, GLboolean reset, GLenum format,
+static void GLAPIENTRY exec_GetMinmax(GLenum target, GLboolean reset, GLenum format,
GLenum type, GLvoid *values)
{
GET_CURRENT_CONTEXT(ctx);
ctx->Exec->GetMinmax( target, reset, format, type, values);
}
-static void exec_GetMinmaxParameterfv(GLenum target, GLenum pname,
+static void GLAPIENTRY exec_GetMinmaxParameterfv(GLenum target, GLenum pname,
GLfloat *params)
{
GET_CURRENT_CONTEXT(ctx);
ctx->Exec->GetMinmaxParameterfv( target, pname, params);
}
-static void exec_GetMinmaxParameteriv(GLenum target, GLenum pname,
+static void GLAPIENTRY exec_GetMinmaxParameteriv(GLenum target, GLenum pname,
GLint *params)
{
GET_CURRENT_CONTEXT(ctx);
ctx->Exec->GetMinmaxParameteriv( target, pname, params);
}
-static void exec_GetSeparableFilter(GLenum target, GLenum format, GLenum type,
+static void GLAPIENTRY exec_GetSeparableFilter(GLenum target, GLenum format, GLenum type,
GLvoid *row, GLvoid *column, GLvoid *span)
{
GET_CURRENT_CONTEXT(ctx);
ctx->Exec->GetSeparableFilter( target, format, type, row, column, span);
}
-static void exec_SeparableFilter2D(GLenum target, GLenum internalFormat,
+static void GLAPIENTRY exec_SeparableFilter2D(GLenum target, GLenum internalFormat,
GLsizei width, GLsizei height, GLenum format,
GLenum type, const GLvoid *row,
const GLvoid *column)
type, row, column);
}
-static void exec_GetPixelTexGenParameterivSGIS(GLenum target, GLint *value)
+static void GLAPIENTRY exec_GetPixelTexGenParameterivSGIS(GLenum target, GLint *value)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
ctx->Exec->GetPixelTexGenParameterivSGIS( target, value);
}
-static void exec_GetPixelTexGenParameterfvSGIS(GLenum target, GLfloat *value)
+static void GLAPIENTRY exec_GetPixelTexGenParameterfvSGIS(GLenum target, GLfloat *value)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
ctx->Exec->GetPixelTexGenParameterfvSGIS( target, value);
}
-static void exec_ColorPointerEXT(GLint size, GLenum type, GLsizei stride,
+static void GLAPIENTRY exec_ColorPointerEXT(GLint size, GLenum type, GLsizei stride,
GLsizei count, const GLvoid *ptr)
{
GET_CURRENT_CONTEXT(ctx);
ctx->Exec->ColorPointerEXT( size, type, stride, count, ptr);
}
-static void exec_EdgeFlagPointerEXT(GLsizei stride, GLsizei count,
+static void GLAPIENTRY exec_EdgeFlagPointerEXT(GLsizei stride, GLsizei count,
const GLboolean *ptr)
{
GET_CURRENT_CONTEXT(ctx);
ctx->Exec->EdgeFlagPointerEXT( stride, count, ptr);
}
-static void exec_IndexPointerEXT(GLenum type, GLsizei stride, GLsizei count,
+static void GLAPIENTRY exec_IndexPointerEXT(GLenum type, GLsizei stride, GLsizei count,
const GLvoid *ptr)
{
GET_CURRENT_CONTEXT(ctx);
ctx->Exec->IndexPointerEXT( type, stride, count, ptr);
}
-static void exec_NormalPointerEXT(GLenum type, GLsizei stride, GLsizei count,
+static void GLAPIENTRY exec_NormalPointerEXT(GLenum type, GLsizei stride, GLsizei count,
const GLvoid *ptr)
{
GET_CURRENT_CONTEXT(ctx);
ctx->Exec->NormalPointerEXT( type, stride, count, ptr);
}
-static void exec_TexCoordPointerEXT(GLint size, GLenum type, GLsizei stride,
+static void GLAPIENTRY exec_TexCoordPointerEXT(GLint size, GLenum type, GLsizei stride,
GLsizei count, const GLvoid *ptr)
{
GET_CURRENT_CONTEXT(ctx);
ctx->Exec->TexCoordPointerEXT( size, type, stride, count, ptr);
}
-static void exec_VertexPointerEXT(GLint size, GLenum type, GLsizei stride,
+static void GLAPIENTRY exec_VertexPointerEXT(GLint size, GLenum type, GLsizei stride,
GLsizei count, const GLvoid *ptr)
{
GET_CURRENT_CONTEXT(ctx);
ctx->Exec->VertexPointerEXT( size, type, stride, count, ptr);
}
-static void exec_LockArraysEXT(GLint first, GLsizei count)
+static void GLAPIENTRY exec_LockArraysEXT(GLint first, GLsizei count)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
ctx->Exec->LockArraysEXT( first, count);
}
-static void exec_UnlockArraysEXT( void )
+static void GLAPIENTRY exec_UnlockArraysEXT( void )
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
ctx->Exec->UnlockArraysEXT( );
}
-static void exec_ResizeBuffersMESA( void )
+static void GLAPIENTRY exec_ResizeBuffersMESA( void )
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
}
-static void exec_ClientActiveTextureARB( GLenum target )
+static void GLAPIENTRY exec_ClientActiveTextureARB( GLenum target )
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
ctx->Exec->ClientActiveTextureARB(target);
}
-static void exec_SecondaryColorPointerEXT(GLint size, GLenum type,
+static void GLAPIENTRY exec_SecondaryColorPointerEXT(GLint size, GLenum type,
GLsizei stride, const GLvoid *ptr)
{
GET_CURRENT_CONTEXT(ctx);
ctx->Exec->SecondaryColorPointerEXT( size, type, stride, ptr);
}
-static void exec_FogCoordPointerEXT(GLenum type, GLsizei stride,
+static void GLAPIENTRY exec_FogCoordPointerEXT(GLenum type, GLsizei stride,
const GLvoid *ptr)
{
GET_CURRENT_CONTEXT(ctx);
}
/* GL_EXT_multi_draw_arrays */
-static void exec_MultiDrawArraysEXT(GLenum mode, GLint *first,
+static void GLAPIENTRY exec_MultiDrawArraysEXT(GLenum mode, GLint *first,
GLsizei *count, GLsizei primcount)
{
GET_CURRENT_CONTEXT(ctx);
}
/* GL_EXT_multi_draw_arrays */
-static void exec_MultiDrawElementsEXT(GLenum mode, const GLsizei *count,
+static void GLAPIENTRY exec_MultiDrawElementsEXT(GLenum mode, const GLsizei *count,
GLenum type, const GLvoid **indices,
GLsizei primcount)
{
}
/* GL_IBM_multimode_draw_arrays */
-static void exec_MultiModeDrawArraysIBM(const GLenum *mode, const GLint *first,
+static void GLAPIENTRY exec_MultiModeDrawArraysIBM(const GLenum *mode, const GLint *first,
const GLsizei *count, GLsizei primcount,
GLint modestride)
{
}
/* GL_IBM_multimode_draw_arrays */
-static void exec_MultiModeDrawElementsIBM(const GLenum *mode,
+static void GLAPIENTRY exec_MultiModeDrawElementsIBM(const GLenum *mode,
const GLsizei *count,
GLenum type,
const GLvoid * const *indices,
-/*
- * Assign all the pointers in <table> to point to Mesa's display list
+
+/**
+ * Setup the given dispatch table to point to Mesa's display list
* building functions.
*
* This does not include any of the tnl functions - they are
{
_mesa_init_no_op_table(table, tableSize);
- _mesa_loopback_init_api_table( table, GL_TRUE );
+ _mesa_loopback_init_api_table( table );
/* GL 1.0 */
table->Accum = save_Accum;
table->AlphaFunc = save_AlphaFunc;
table->Bitmap = save_Bitmap;
- table->BlendFunc = save_BlendFunc;
table->CallList = _mesa_save_CallList;
table->CallLists = _mesa_save_CallLists;
table->Clear = save_Clear;
* VertexAttribPointerNV, GetProgram*, GetVertexAttrib*
*/
table->BindProgramNV = save_BindProgramNV;
- table->DeleteProgramsNV = _mesa_DeleteProgramsNV;
+ table->DeleteProgramsNV = _mesa_DeletePrograms;
table->ExecuteProgramNV = save_ExecuteProgramNV;
- table->GenProgramsNV = _mesa_GenProgramsNV;
+ table->GenProgramsNV = _mesa_GenPrograms;
table->AreProgramsResidentNV = _mesa_AreProgramsResidentNV;
table->RequestResidentProgramsNV = save_RequestResidentProgramsNV;
table->GetProgramParameterfvNV = _mesa_GetProgramParameterfvNV;
table->GetVertexAttribfvNV = _mesa_GetVertexAttribfvNV;
table->GetVertexAttribivNV = _mesa_GetVertexAttribivNV;
table->GetVertexAttribPointervNV = _mesa_GetVertexAttribPointervNV;
- table->IsProgramNV = _mesa_IsProgramNV;
+ table->IsProgramNV = _mesa_IsProgram;
table->LoadProgramNV = save_LoadProgramNV;
table->ProgramParameter4dNV = save_ProgramParameter4dNV;
table->ProgramParameter4dvNV = save_ProgramParameter4dvNV;
/* aliased with MESA_window_pos functions */
/* ARB 26. GL_ARB_vertex_program */
- /* XXX todo */
- /* ARB 27. GL_ARB_vertex_program */
- /* XXX todo */
+ /* ARB 27. GL_ARB_fragment_program */
+#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
+ /* glVertexAttrib* functions alias the NV ones, handled elsewhere */
+ table->VertexAttribPointerARB = _mesa_VertexAttribPointerARB;
+ table->EnableVertexAttribArrayARB = _mesa_EnableVertexAttribArrayARB;
+ table->DisableVertexAttribArrayARB = _mesa_DisableVertexAttribArrayARB;
+ table->ProgramStringARB = save_ProgramStringARB;
+ table->BindProgramNV = _mesa_BindProgram;
+ table->DeleteProgramsNV = _mesa_DeletePrograms;
+ table->GenProgramsNV = _mesa_GenPrograms;
+ table->IsProgramNV = _mesa_IsProgram;
+ table->GetVertexAttribdvNV = _mesa_GetVertexAttribdvNV;
+ table->GetVertexAttribfvNV = _mesa_GetVertexAttribfvNV;
+ table->GetVertexAttribivNV = _mesa_GetVertexAttribivNV;
+ table->GetVertexAttribPointervNV = _mesa_GetVertexAttribPointervNV;
+ table->ProgramEnvParameter4dARB = save_ProgramEnvParameter4dARB;
+ table->ProgramEnvParameter4dvARB = save_ProgramEnvParameter4dvARB;
+ table->ProgramEnvParameter4fARB = save_ProgramEnvParameter4fARB;
+ table->ProgramEnvParameter4fvARB = save_ProgramEnvParameter4fvARB;
+ table->ProgramLocalParameter4dARB = save_ProgramLocalParameter4dARB;
+ table->ProgramLocalParameter4dvARB = save_ProgramLocalParameter4dvARB;
+ table->ProgramLocalParameter4fARB = save_ProgramLocalParameter4fARB;
+ table->ProgramLocalParameter4fvARB = save_ProgramLocalParameter4fvARB;
+ table->GetProgramEnvParameterdvARB = _mesa_GetProgramEnvParameterdvARB;
+ table->GetProgramEnvParameterfvARB = _mesa_GetProgramEnvParameterfvARB;
+ table->GetProgramLocalParameterdvARB = _mesa_GetProgramLocalParameterdvARB;
+ table->GetProgramLocalParameterfvARB = _mesa_GetProgramLocalParameterfvARB;
+ table->GetProgramivARB = _mesa_GetProgramivARB;
+ table->GetProgramStringARB = _mesa_GetProgramStringARB;
+#endif
+
/* ARB 28. GL_ARB_vertex_buffer_object */
- /* XXX todo */
+#if FEATURE_ARB_vertex_buffer_object
+ /* None of the extension's functions get compiled */
+ table->BindBufferARB = _mesa_BindBufferARB;
+ table->BufferDataARB = _mesa_BufferDataARB;
+ table->BufferSubDataARB = _mesa_BufferSubDataARB;
+ table->DeleteBuffersARB = _mesa_DeleteBuffersARB;
+ table->GenBuffersARB = _mesa_GenBuffersARB;
+ table->GetBufferParameterivARB = _mesa_GetBufferParameterivARB;
+ table->GetBufferPointervARB = _mesa_GetBufferPointervARB;
+ table->GetBufferSubDataARB = _mesa_GetBufferSubDataARB;
+ table->IsBufferARB = _mesa_IsBufferARB;
+ table->MapBufferARB = _mesa_MapBufferARB;
+ table->UnmapBufferARB = _mesa_UnmapBufferARB;
+#endif
}
* Print the commands in a display list. For debugging only.
* TODO: many commands aren't handled yet.
*/
-static void print_list( GLcontext *ctx, GLuint list )
+static void GLAPIENTRY print_list( GLcontext *ctx, GLuint list )
{
Node *n;
GLboolean done;
_mesa_lookup_enum_by_nr(n[1].ui));
break;
case OPCODE_MAP1:
- _mesa_printf("Map1 %s %.3f %.3f %d %d\n",
+ _mesa_printf("Map1 %s %.3f %.3f %d %d\n",
_mesa_lookup_enum_by_nr(n[1].ui),
n[2].f, n[3].f, n[4].i, n[5].i);
break;
case OPCODE_MAP2:
- _mesa_printf("Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
+ _mesa_printf("Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
_mesa_lookup_enum_by_nr(n[1].ui),
n[2].f, n[3].f, n[4].f, n[5].f,
n[6].i, n[7].i, n[8].i, n[9].i);
n[1].i, n[2].f, n[3].f);
break;
case OPCODE_MAPGRID2:
- _mesa_printf("MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
+ _mesa_printf("MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
n[1].i, n[2].f, n[3].f,
n[4].i, n[5].f, n[6].f);
break;
/***** Initialization *****/
/**********************************************************************/
+
+void _mesa_save_vtxfmt_init( GLvertexformat *vfmt )
+{
+ vfmt->ArrayElement = _ae_loopback_array_elt; /* generic helper */
+ vfmt->Begin = save_Begin;
+ vfmt->CallList = _mesa_save_CallList;
+ vfmt->CallLists = _mesa_save_CallLists;
+ vfmt->Color3f = save_Color3f;
+ vfmt->Color3fv = save_Color3fv;
+ vfmt->Color4f = save_Color4f;
+ vfmt->Color4fv = save_Color4fv;
+ vfmt->EdgeFlag = save_EdgeFlag;
+ vfmt->EdgeFlagv = save_EdgeFlagv;
+ vfmt->End = save_End;
+ vfmt->EvalCoord1f = save_EvalCoord1f;
+ vfmt->EvalCoord1fv = save_EvalCoord1fv;
+ vfmt->EvalCoord2f = save_EvalCoord2f;
+ vfmt->EvalCoord2fv = save_EvalCoord2fv;
+ vfmt->EvalPoint1 = save_EvalPoint1;
+ vfmt->EvalPoint2 = save_EvalPoint2;
+ vfmt->FogCoordfEXT = save_FogCoordfEXT;
+ vfmt->FogCoordfvEXT = save_FogCoordfvEXT;
+ vfmt->Indexf = save_Indexf;
+ vfmt->Indexfv = save_Indexfv;
+ vfmt->Materialfv = save_Materialfv;
+ vfmt->MultiTexCoord1fARB = save_MultiTexCoord1f;
+ vfmt->MultiTexCoord1fvARB = save_MultiTexCoord1fv;
+ vfmt->MultiTexCoord2fARB = save_MultiTexCoord2f;
+ vfmt->MultiTexCoord2fvARB = save_MultiTexCoord2fv;
+ vfmt->MultiTexCoord3fARB = save_MultiTexCoord3f;
+ vfmt->MultiTexCoord3fvARB = save_MultiTexCoord3fv;
+ vfmt->MultiTexCoord4fARB = save_MultiTexCoord4f;
+ vfmt->MultiTexCoord4fvARB = save_MultiTexCoord4fv;
+ vfmt->Normal3f = save_Normal3f;
+ vfmt->Normal3fv = save_Normal3fv;
+ vfmt->SecondaryColor3fEXT = save_SecondaryColor3fEXT;
+ vfmt->SecondaryColor3fvEXT = save_SecondaryColor3fvEXT;
+ vfmt->TexCoord1f = save_TexCoord1f;
+ vfmt->TexCoord1fv = save_TexCoord1fv;
+ vfmt->TexCoord2f = save_TexCoord2f;
+ vfmt->TexCoord2fv = save_TexCoord2fv;
+ vfmt->TexCoord3f = save_TexCoord3f;
+ vfmt->TexCoord3fv = save_TexCoord3fv;
+ vfmt->TexCoord4f = save_TexCoord4f;
+ vfmt->TexCoord4fv = save_TexCoord4fv;
+ vfmt->Vertex2f = save_Vertex2f;
+ vfmt->Vertex2fv = save_Vertex2fv;
+ vfmt->Vertex3f = save_Vertex3f;
+ vfmt->Vertex3fv = save_Vertex3fv;
+ vfmt->Vertex4f = save_Vertex4f;
+ vfmt->Vertex4fv = save_Vertex4fv;
+ vfmt->VertexAttrib1fNV = save_VertexAttrib1fNV;
+ vfmt->VertexAttrib1fvNV = save_VertexAttrib1fvNV;
+ vfmt->VertexAttrib2fNV = save_VertexAttrib2fNV;
+ vfmt->VertexAttrib2fvNV = save_VertexAttrib2fvNV;
+ vfmt->VertexAttrib3fNV = save_VertexAttrib3fNV;
+ vfmt->VertexAttrib3fvNV = save_VertexAttrib3fvNV;
+ vfmt->VertexAttrib4fNV = save_VertexAttrib4fNV;
+ vfmt->VertexAttrib4fvNV = save_VertexAttrib4fvNV;
+
+ vfmt->EvalMesh1 = _mesa_save_EvalMesh1;
+ vfmt->EvalMesh2 = _mesa_save_EvalMesh2;
+ vfmt->Rectf = save_Rectf;
+
+ /* The driver is required to implement these as
+ * 1) They can probably do a better job.
+ * 2) A lot of new mechanisms would have to be added to this module
+ * to support it. That code would probably never get used,
+ * because of (1).
+ */
+#if 0
+ vfmt->DrawArrays = 0;
+ vfmt->DrawElements = 0;
+ vfmt->DrawRangeElements = 0;
+#endif
+}
+
+
+
void _mesa_init_display_list( GLcontext * ctx )
{
/* Display list */
- ctx->CallDepth = 0;
+ ctx->ListState.CallDepth = 0;
ctx->ExecuteFlag = GL_TRUE;
ctx->CompileFlag = GL_FALSE;
- ctx->CurrentListPtr = NULL;
- ctx->CurrentBlock = NULL;
- ctx->CurrentListNum = 0;
- ctx->CurrentPos = 0;
+ ctx->ListState.CurrentListPtr = NULL;
+ ctx->ListState.CurrentBlock = NULL;
+ ctx->ListState.CurrentListNum = 0;
+ ctx->ListState.CurrentPos = 0;
/* Display List group */
ctx->List.ListBase = 0;
+ _mesa_save_vtxfmt_init( &ctx->ListState.ListVtxfmt );
}