summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/dlist.c
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2009-09-09 15:00:08 +0800
committerBrian Paul <[email protected]>2009-09-30 08:31:56 -0600
commita73ba2d31b87e974f6846a8aaced704634f6f657 (patch)
treeb89eb6d9c8cf070c4ebbfd152a2aa1b853ad20ba /src/mesa/main/dlist.c
parentaefa1f6ab1d9267b223b06ae205ab34c8e0d7c02 (diff)
mesa/main: Make FEATURE_dlist follow feature conventions.
As shown in mfeatures.h, this allows users of dlist.h to work without knowing if the feature is available.
Diffstat (limited to 'src/mesa/main/dlist.c')
-rw-r--r--src/mesa/main/dlist.c64
1 files changed, 49 insertions, 15 deletions
diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index 189743e5f56..6354ed74748 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -73,6 +73,7 @@
#include "texstate.h"
#include "mtypes.h"
#include "varray.h"
+#include "vtxfmt.h"
#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
#include "shader/arbprogram.h"
#include "shader/program.h"
@@ -438,6 +439,10 @@ typedef union gl_dlist_node Node;
*/
static GLuint InstSize[OPCODE_END_OF_LIST + 1];
+
+#if FEATURE_dlist
+
+
void mesa_print_display_list(GLuint list);
@@ -1047,8 +1052,8 @@ static void invalidate_saved_current_state( GLcontext *ctx )
ctx->Driver.CurrentSavePrimitive = PRIM_UNKNOWN;
}
-void GLAPIENTRY
-_mesa_save_CallList(GLuint list)
+static void GLAPIENTRY
+save_CallList(GLuint list)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
@@ -1070,8 +1075,8 @@ _mesa_save_CallList(GLuint list)
}
-void GLAPIENTRY
-_mesa_save_CallLists(GLsizei num, GLenum type, const GLvoid * lists)
+static void GLAPIENTRY
+save_CallLists(GLsizei num, GLenum type, const GLvoid * lists)
{
GET_CURRENT_CONTEXT(ctx);
GLint i;
@@ -7426,7 +7431,7 @@ execute_list(GLcontext *ctx, GLuint list)
/**
* Test if a display list number is valid.
*/
-GLboolean GLAPIENTRY
+static GLboolean GLAPIENTRY
_mesa_IsList(GLuint list)
{
GET_CURRENT_CONTEXT(ctx);
@@ -7439,7 +7444,7 @@ _mesa_IsList(GLuint list)
/**
* Delete a sequence of consecutive display lists.
*/
-void GLAPIENTRY
+static void GLAPIENTRY
_mesa_DeleteLists(GLuint list, GLsizei range)
{
GET_CURRENT_CONTEXT(ctx);
@@ -7461,7 +7466,7 @@ _mesa_DeleteLists(GLuint list, GLsizei range)
* Return a display list number, n, such that lists n through n+range-1
* are free.
*/
-GLuint GLAPIENTRY
+static GLuint GLAPIENTRY
_mesa_GenLists(GLsizei range)
{
GET_CURRENT_CONTEXT(ctx);
@@ -7501,7 +7506,7 @@ _mesa_GenLists(GLsizei range)
/**
* Begin a new display list.
*/
-void GLAPIENTRY
+static void GLAPIENTRY
_mesa_NewList(GLuint name, GLenum mode)
{
GET_CURRENT_CONTEXT(ctx);
@@ -7551,7 +7556,7 @@ _mesa_NewList(GLuint name, GLenum mode)
/**
* End definition of current display list.
*/
-void GLAPIENTRY
+static void GLAPIENTRY
_mesa_EndList(void)
{
GET_CURRENT_CONTEXT(ctx);
@@ -7685,7 +7690,7 @@ _mesa_CallLists(GLsizei n, GLenum type, const GLvoid * lists)
/**
* Set the offset added to list numbers in glCallLists.
*/
-void GLAPIENTRY
+static void GLAPIENTRY
_mesa_ListBase(GLuint base)
{
GET_CURRENT_CONTEXT(ctx);
@@ -8420,7 +8425,7 @@ exec_MultiModeDrawElementsIBM(const GLenum * mode,
* struct.
*/
void
-_mesa_init_dlist_table(struct _glapi_table *table)
+_mesa_init_save_table(struct _glapi_table *table)
{
_mesa_loopback_init_api_table(table);
@@ -8429,8 +8434,8 @@ _mesa_init_dlist_table(struct _glapi_table *table)
SET_AlphaFunc(table, save_AlphaFunc);
SET_Bitmap(table, save_Bitmap);
SET_BlendFunc(table, save_BlendFunc);
- SET_CallList(table, _mesa_save_CallList);
- SET_CallLists(table, _mesa_save_CallLists);
+ SET_CallList(table, save_CallList);
+ SET_CallLists(table, save_CallLists);
SET_Clear(table, save_Clear);
SET_ClearAccum(table, save_ClearAccum);
SET_ClearColor(table, save_ClearColor);
@@ -9294,8 +9299,9 @@ _mesa_save_vtxfmt_init(GLvertexformat * vfmt)
_MESA_INIT_ARRAYELT_VTXFMT(vfmt, _ae_);
vfmt->Begin = save_Begin;
- vfmt->CallList = _mesa_save_CallList;
- vfmt->CallLists = _mesa_save_CallLists;
+
+ _MESA_INIT_DLIST_VTXFMT(vfmt, save_);
+
vfmt->Color3f = save_Color3f;
vfmt->Color3fv = save_Color3fv;
vfmt->Color4f = save_Color4f;
@@ -9373,6 +9379,32 @@ _mesa_save_vtxfmt_init(GLvertexformat * vfmt)
}
+void
+_mesa_install_dlist_vtxfmt(struct _glapi_table *disp,
+ const GLvertexformat *vfmt)
+{
+ SET_CallList(disp, vfmt->CallList);
+ SET_CallLists(disp, vfmt->CallLists);
+}
+
+
+void _mesa_init_dlist_dispatch(struct _glapi_table *disp)
+{
+ SET_CallList(disp, _mesa_CallList);
+ SET_CallLists(disp, _mesa_CallLists);
+
+ SET_DeleteLists(disp, _mesa_DeleteLists);
+ SET_EndList(disp, _mesa_EndList);
+ SET_GenLists(disp, _mesa_GenLists);
+ SET_IsList(disp, _mesa_IsList);
+ SET_ListBase(disp, _mesa_ListBase);
+ SET_NewList(disp, _mesa_NewList);
+}
+
+
+#endif /* FEATURE_dlist */
+
+
/**
* Initialize display list state for given context.
*/
@@ -9397,5 +9429,7 @@ _mesa_init_display_list(GLcontext *ctx)
/* Display List group */
ctx->List.ListBase = 0;
+#if FEATURE_dlist
_mesa_save_vtxfmt_init(&ctx->ListState.ListVtxfmt);
+#endif
}