added _mesa_init_no_op_table()
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
/* $Id: dispatch.c,v 1.3 1999/11/12 23:38:42 brianp Exp $ */
|
/* $Id: dispatch.c,v 1.4 1999/11/27 21:40:28 brianp Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mesa 3-D graphics library
|
* Mesa 3-D graphics library
|
||||||
@@ -47,6 +47,7 @@
|
|||||||
#include "feedback.h"
|
#include "feedback.h"
|
||||||
#include "fog.h"
|
#include "fog.h"
|
||||||
#include "get.h"
|
#include "get.h"
|
||||||
|
#include "glapi.h"
|
||||||
#include "glmisc.h"
|
#include "glmisc.h"
|
||||||
#include "imaging.h"
|
#include "imaging.h"
|
||||||
#include "light.h"
|
#include "light.h"
|
||||||
@@ -72,6 +73,28 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
generic_noop(void)
|
||||||
|
{
|
||||||
|
#ifdef DEBUG
|
||||||
|
gl_problem(NULL, "undefined function dispatch");
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
_mesa_init_no_op_table(struct _glapi_table *exec)
|
||||||
|
{
|
||||||
|
const GLuint n = _glapi_get_dispatch_table_size();
|
||||||
|
GLuint i;
|
||||||
|
void **dispatch = (void **) exec;
|
||||||
|
for (i = 0; i < n; i++) {
|
||||||
|
dispatch[i] = (void *) generic_noop;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initialize the given dispatch table with pointers to Mesa's
|
* Initialize the given dispatch table with pointers to Mesa's
|
||||||
* immediate-mode commands.
|
* immediate-mode commands.
|
||||||
@@ -79,6 +102,15 @@
|
|||||||
void
|
void
|
||||||
_mesa_init_exec_table(struct _glapi_table *exec)
|
_mesa_init_exec_table(struct _glapi_table *exec)
|
||||||
{
|
{
|
||||||
|
/* Check to be sure the dispatcher's table is at least as big as Mesa's. */
|
||||||
|
const GLuint size = sizeof(struct _glapi_table) / sizeof(void *);
|
||||||
|
assert(_glapi_get_dispatch_table_size() >= size);
|
||||||
|
|
||||||
|
|
||||||
|
/* first initialize all dispatch slots to no-op */
|
||||||
|
_mesa_init_no_op_table(exec);
|
||||||
|
|
||||||
|
/* load the dispatch slots we understand */
|
||||||
exec->Accum = _mesa_Accum;
|
exec->Accum = _mesa_Accum;
|
||||||
exec->AlphaFunc = _mesa_AlphaFunc;
|
exec->AlphaFunc = _mesa_AlphaFunc;
|
||||||
exec->Begin = _mesa_Begin;
|
exec->Begin = _mesa_Begin;
|
||||||
|
Reference in New Issue
Block a user