now using dynamically allocated api dispatch tables
This commit is contained in:
parent
ef5d084d3c
commit
3ab6bbe613
|
@ -1,4 +1,4 @@
|
|||
/* $Id: context.c,v 1.42 2000/02/03 19:40:07 brianp Exp $ */
|
||||
/* $Id: context.c,v 1.43 2000/02/12 17:26:15 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
|
@ -1374,9 +1374,19 @@ GLboolean gl_initialize_context_data( GLcontext *ctx,
|
|||
}
|
||||
|
||||
/* setup API dispatch tables */
|
||||
_mesa_init_exec_table( &ctx->Exec );
|
||||
_mesa_init_dlist_table( &ctx->Save );
|
||||
ctx->CurrentDispatch = &ctx->Exec;
|
||||
ctx->Exec = CALLOC(_glapi_get_dispatch_table_size() * sizeof(void *));
|
||||
ctx->Save = CALLOC(_glapi_get_dispatch_table_size() * sizeof(void *));
|
||||
if (!ctx->Exec || !ctx->Save) {
|
||||
free_shared_state(ctx, ctx->Shared);
|
||||
FREE(ctx->VB);
|
||||
FREE(ctx->PB);
|
||||
if (ctx->Exec)
|
||||
FREE(ctx->Exec);
|
||||
FREE(ctx);
|
||||
}
|
||||
_mesa_init_exec_table( ctx->Exec );
|
||||
_mesa_init_dlist_table( ctx->Save );
|
||||
ctx->CurrentDispatch = ctx->Exec;
|
||||
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
@ -1513,6 +1523,9 @@ void gl_free_context_data( GLcontext *ctx )
|
|||
ctx->freed_im_queue = next;
|
||||
}
|
||||
gl_extensions_dtr(ctx);
|
||||
|
||||
FREE(ctx->Exec);
|
||||
FREE(ctx->Save);
|
||||
}
|
||||
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,4 +1,4 @@
|
|||
/* $Id: teximage.c,v 1.15 2000/01/31 23:10:16 brianp Exp $ */
|
||||
/* $Id: teximage.c,v 1.16 2000/02/12 17:26:15 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
|
@ -1674,7 +1674,7 @@ _mesa_CopyTexImage1D( GLenum target, GLint level,
|
|||
gl_error( ctx, GL_OUT_OF_MEMORY, "glCopyTexImage1D" );
|
||||
return;
|
||||
}
|
||||
(*ctx->Exec.TexImage1D)( target, level, internalFormat, width,
|
||||
(*ctx->Exec->TexImage1D)( target, level, internalFormat, width,
|
||||
border, GL_RGBA, GL_UNSIGNED_BYTE, image );
|
||||
FREE(image);
|
||||
}
|
||||
|
@ -1697,7 +1697,7 @@ _mesa_CopyTexImage2D( GLenum target, GLint level, GLenum internalFormat,
|
|||
gl_error( ctx, GL_OUT_OF_MEMORY, "glCopyTexImage2D" );
|
||||
return;
|
||||
}
|
||||
(ctx->Exec.TexImage2D)( target, level, internalFormat, width,
|
||||
(ctx->Exec->TexImage2D)( target, level, internalFormat, width,
|
||||
height, border, GL_RGBA, GL_UNSIGNED_BYTE, image );
|
||||
FREE(image);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue