1. Remove all.h and PC_HEADER junk.
2. Rolled mem.c and mem.h into imports.c and imports.h
3. Include imports.h instead of mem.h
Restore _mesa_create/initialize_context() to be like they were in 4.0.4
New wrappers for a few std C functions: _mesa_atoi(), _mesa_strstr(), etc.
-# $Id: Makefile.X11,v 1.70 2002/10/16 17:57:03 brianp Exp $
+# $Id: Makefile.X11,v 1.71 2002/10/24 23:57:19 brianp Exp $
# Mesa 3-D graphics library
# Version: 4.1
light.c \
lines.c \
matrix.c \
- mem.c \
mmath.c \
pixel.c \
points.c \
-/* $Id: ac_context.c,v 1.7 2002/04/21 19:39:48 brianp Exp $ */
+/* $Id: ac_context.c,v 1.8 2002/10/24 23:57:24 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "glheader.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "mmath.h"
#include "mtypes.h"
-/* $Id: ac_import.c,v 1.19 2002/04/21 21:03:02 brianp Exp $ */
+/* $Id: ac_import.c,v 1.20 2002/10/24 23:57:24 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "glheader.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "mmath.h"
#include "mtypes.h"
{\r
AMesaContext context;\r
GLboolean direct = GL_FALSE;\r
- __GLimports imports;
\r
context = (AMesaContext)calloc(1, sizeof(struct amesa_context));\r
if (!context)\r
context->Buffer = NULL;\r
context->ClearColor = 0;\r
context->CurrentColor = 0;\r
- _mesa_init_default_imports( &imports, (void *) context);
context->GLContext = _mesa_create_context(visual->GLVisual,\r
share ? share->GLContext : NULL,\r
- &imports );\r
+ (void *) context, GL_FALSE );\r
if (!context->GLContext)\r
{\r
free(context);\r
*/\r
\r
\r
-#ifdef PC_HEADER\r
-#include "all.h"\r
-#else\r
#include "glheader.h"\r
#include "context.h"\r
#include "GL/dmesa.h"\r
#include "tnl/tnl.h"\r
#include "tnl/t_context.h"\r
#include "tnl/t_pipeline.h"\r
-#endif\r
\r
#include "video.h"\r
\r
int err;
ggi_color pal[256];
int i;
- __GLimports imports;
GGIMESADPRINT_CORE("ggiMesaCreateContext() called\n");
ctx->ggi_visual = vis;
ctx->color = 0;
- _mesa_init_default_imports( &imports, (void *) ctx);
ctx->gl_ctx =
_mesa_create_context(&(LIBGGI_MESAEXT(vis)->mesa_visual.gl_visual),
- NULL, &imports);
+ NULL, (void *) ctx, GL_FALSE);
if (!ctx->gl_ctx)
goto free_context;
-/* $Id: fxapi.c,v 1.34 2002/10/14 17:08:25 brianp Exp $ */
+/* $Id: fxapi.c,v 1.35 2002/10/24 23:57:23 brianp Exp $ */
/*
* Mesa 3-D graphics library
char *errorstr;
GLboolean useBGR;
char *system = NULL;
- __GLimports imports;
if (MESA_VERBOSE & VERBOSE_DRIVER) {
fprintf(stderr, "fxmesa: fxMesaCreateContext() Start\n");
goto errorhandler;
}
- _mesa_init_default_imports( &imports, (void *) fxMesa);
ctx = fxMesa->glCtx = _mesa_create_context(fxMesa->glVis,
shareCtx,
- &imports);
+ (void *) fxMesa, GL_TRUE);
if (!ctx) {
errorstr = "_mesa_create_context";
goto errorhandler;
-/* $Id: fxdrv.h,v 1.53 2002/06/13 04:28:30 brianp Exp $ */
+/* $Id: fxdrv.h,v 1.54 2002/10/24 23:57:23 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "imports.h"
#include "macros.h"
#include "matrix.h"
-#include "mem.h"
#include "mtypes.h"
#include "GL/fxmesa.h"
-/* $Id: fxtris.c,v 1.19 2002/08/21 02:56:58 brianp Exp $ */
+/* $Id: fxtris.c,v 1.20 2002/10/24 23:57:23 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Keith Whitwell <keithw@valinux.com>
*/
-#ifdef HAVE_CONFIG_H
-#include "conf.h"
-#endif
+#include "glheader.h"
#ifdef FX
-#include <stdio.h>
-#include <math.h>
-
-#include "glheader.h"
#include "mtypes.h"
#include "macros.h"
#include "colormac.h"
-/* $Id: fxvb.c,v 1.14 2002/06/15 03:03:10 brianp Exp $ */
+/* $Id: fxvb.c,v 1.15 2002/10/24 23:57:23 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "glheader.h"
#include "mtypes.h"
-#include "mem.h"
+#include "imports.h"
#include "macros.h"
#include "colormac.h"
#include "mmath.h"
-/* $Id: fxwgl.c,v 1.15 2002/09/04 14:14:36 brianp Exp $ */
+/* $Id: fxwgl.c,v 1.16 2002/10/24 23:57:23 brianp Exp $ */
/*
* Mesa 3-D graphics library
{
#endif
-#include "fxdrv.h"
#include <windows.h>
-#include "GL/gl.h"
+#include "glheader.h"
+#include "fxdrv.h"
#include "glapi.h"
#ifdef __cplusplus
-/* $Id: osmesa.c,v 1.92 2002/10/17 15:26:38 brianp Exp $ */
+/* $Id: osmesa.c,v 1.93 2002/10/24 23:57:23 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "imports.h"
#include "macros.h"
#include "matrix.h"
-#include "mem.h"
#include "mmath.h"
#include "mtypes.h"
#include "texformat.h"
const GLuint i4 = 1;
const GLubyte *i1 = (GLubyte *) &i4;
const GLint little_endian = *i1;
- __GLimports imports;
rind = gind = bind = aind = 0;
if (format==OSMESA_COLOR_INDEX) {
return NULL;
}
- _mesa_init_default_imports( &imports, (void *) osmesa );
if (!_mesa_initialize_context(&osmesa->gl_ctx,
osmesa->gl_visual,
sharelist ? &sharelist->gl_ctx
: (GLcontext *) NULL,
- &imports)) {
+ (void *) osmesa,
+ GL_FALSE)) {
_mesa_destroy_visual( osmesa->gl_visual );
FREE(osmesa);
return NULL;
-/* $Id: svgamesa.c,v 1.21 2002/10/14 17:08:27 brianp Exp $ */
+/* $Id: svgamesa.c,v 1.22 2002/10/24 23:57:23 brianp Exp $ */
/*
* Mesa 3-D graphics library
#ifdef SVGA
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "matrix.h"
#include "mtypes.h"
#include "swrast/swrast.h"
-#endif
-
#include "svgapix.h"
#include "svgamesa8.h"
#include "svgamesa15.h"
GLfloat redscale, greenscale, bluescale, alphascale;
GLint index_bits;
GLint redbits, greenbits, bluebits, alphabits;
- __GLimports imports;
/* determine if we're in RGB or color index mode */
if ((SVGABuffer.Depth==32) || (SVGABuffer.Depth==24)) {
1 /* samples */
);
- _mesa_init_default_imports( &imports, (void *) ctx);
ctx->gl_ctx = _mesa_create_context( ctx->gl_vis,
NULL, /* share list context */
- &imports );
+ (void *) ctx, GL_FALSE );
_mesa_enable_sw_extensions(ctx->gl_ctx);
_mesa_enable_1_3_extensions(ctx->gl_ctx);
-/* $Id: wmesa.c,v 1.40 2002/10/14 17:08:28 brianp Exp $ */
+/* $Id: wmesa.c,v 1.41 2002/10/24 23:57:23 brianp Exp $ */
/*
* Windows (Win32) device driver for Mesa 3.4
#include "imports.h"
#include "macros.h"
#include "matrix.h"
-#include "mem.h"
#include "mmath.h"
#include "mtypes.h"
#include "texformat.h"
RECT CR;
WMesaContext c;
GLboolean true_color_flag;
- __GLimports imports;
c = (struct wmesa_context * ) calloc(1,sizeof(struct wmesa_context));
if (!c)
return NULL;
}
- _mesa_init_default_imports( &imports, (void *) c );
-
/* allocate a new Mesa context */
- c->gl_ctx = _mesa_create_context( c->gl_visual, NULL, &imports );
+ c->gl_ctx = _mesa_create_context( c->gl_visual, NULL, (void *) c, GL_FALSE );
if (!c->gl_ctx) {
_mesa_destroy_visual( c->gl_visual );
//HDC DC;\r
RECT CR;\r
WMesaContext c;\r
- __GLimports imports;\r
\r
c = (struct wmesa_context * ) calloc(1,sizeof(struct wmesa_context));\r
if (!c)\r
}\r
\r
/* allocate a new Mesa context */\r
- _mesa_init_default_imports( &imports, (void *) c );\r
- c->gl_ctx = _mesa_create_context( c->gl_visual, &imports );\r
+ c->gl_ctx = _mesa_create_context( c->gl_visual, NULL, (void *) g, GL_FALSE );\r
\r
if (!c->gl_ctx) {\r
_mesa_destroy_visual( c->gl_visual );\r
-/* $Id: fakeglx.c,v 1.69 2002/10/05 18:27:41 brianp Exp $ */
+/* $Id: fakeglx.c,v 1.70 2002/10/24 23:57:23 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "context.h"
#include "config.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "mmath.h"
#include "mtypes.h"
#include "xfonts.h"
{
XMesaVisual xmvis = choose_visual(dpy, screen, attribList);
if (xmvis) {
- GLXFBConfig *config = malloc(sizeof(XMesaVisual));
+ GLXFBConfig *config = _mesa_malloc(sizeof(XMesaVisual));
if (!config) {
*nitems = 0;
return NULL;
visuals = XGetVisualInfo(dpy, visMask, &visTemplate, nelements);
if (*nelements > 0) {
XMesaVisual *results;
- results = malloc(*nelements * sizeof(XMesaVisual));
+ results = _mesa_malloc(*nelements * sizeof(XMesaVisual));
if (!results) {
*nelements = 0;
return NULL;
-/* $Id: xfonts.c,v 1.14 2001/04/26 19:28:02 brianp Exp $ */
+/* $Id: xfonts.c,v 1.15 2002/10/24 23:57:23 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include <GL/vms_x_fix.h>
#endif
-#ifdef HAVE_CONFIG_H
-#include "conf.h"
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-#include "GL/gl.h"
-#include "GL/glx.h"
+#include "glxheader.h"
#include "context.h"
-#include "mem.h"
+#include "imports.h"
#include "xfonts.h"
-/* $Id: xm_api.c,v 1.45 2002/10/14 17:08:34 brianp Exp $ */
+/* $Id: xm_api.c,v 1.46 2002/10/24 23:57:23 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "glthread.h"
#include "imports.h"
#include "matrix.h"
-#include "mem.h"
#include "mmath.h"
#include "mtypes.h"
-#ifdef HAVE_CONFIG_H
-#include "conf.h"
-#endif
#include "macros.h"
#include "texformat.h"
#include "texstore.h"
static GLboolean firstTime = GL_TRUE;
XMesaContext c;
GLcontext *ctx;
- __GLimports imports;
+ GLboolean direct = GL_TRUE; /* not really */
if (firstTime) {
_glthread_INIT_MUTEX(_xmesa_lock);
return NULL;
}
- _mesa_init_default_imports( &imports, (void *) c );
ctx = c->gl_ctx = _mesa_create_context( &v->mesa_visual,
share_list ? share_list->gl_ctx : (GLcontext *) NULL,
- &imports );
+ (void *) c, direct);
if (!c->gl_ctx) {
FREE(c);
return NULL;
-/* $Id: xm_dd.c,v 1.39 2002/10/14 17:08:38 brianp Exp $ */
+/* $Id: xm_dd.c,v 1.40 2002/10/24 23:57:23 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "drawpix.h"
#include "extensions.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "mtypes.h"
#include "state.h"
#include "texstore.h"
-/* $Id: xm_span.c,v 1.16 2002/10/04 19:10:12 brianp Exp $ */
+/* $Id: xm_span.c,v 1.17 2002/10/24 23:57:23 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "drawpix.h"
#include "extensions.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "mtypes.h"
#include "state.h"
#include "xmesaP.h"
-/* $Id: xm_tri.c,v 1.27 2002/08/07 00:45:07 brianp Exp $ */
+/* $Id: xm_tri.c,v 1.28 2002/10/24 23:57:23 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "glxheader.h"
#include "depth.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "mmath.h"
#include "mtypes.h"
#include "xmesaP.h"
-/* $Id: glthread.c,v 1.9 2001/11/12 23:50:12 brianp Exp $ */
+/* $Id: glthread.c,v 1.10 2002/10/24 23:57:20 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2002 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"),
*/
-#ifdef PC_ALL
-#include "all.h"
-#else
#include "glheader.h"
#include "glthread.h"
-#endif
/*
-# $Id: Makefile.X11,v 1.70 2002/10/16 17:57:03 brianp Exp $
+# $Id: Makefile.X11,v 1.71 2002/10/24 23:57:19 brianp Exp $
# Mesa 3-D graphics library
# Version: 4.1
light.c \
lines.c \
matrix.c \
- mem.c \
mmath.c \
pixel.c \
points.c \
-/* $Id: accum.c,v 1.38 2001/09/14 21:36:43 brianp Exp $ */
+/* $Id: accum.c,v 1.39 2002/10/24 23:57:19 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2002 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"),
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
#include "accum.h"
#include "context.h"
+#include "imports.h"
#include "macros.h"
-#include "mem.h"
#include "state.h"
#include "mtypes.h"
-#endif
-
-
void
-/* $Id: api_arrayelt.c,v 1.9 2002/06/15 02:38:15 brianp Exp $ */
+/* $Id: api_arrayelt.c,v 1.10 2002/10/24 23:57:19 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "api_arrayelt.h"
#include "context.h"
#include "glapi.h"
-#include "mem.h"
+#include "imports.h"
#include "macros.h"
#include "mtypes.h"
-/* $Id: api_validate.c,v 1.6 2002/04/21 21:04:46 brianp Exp $ */
+/* $Id: api_validate.c,v 1.7 2002/10/24 23:57:19 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "glheader.h"
#include "api_validate.h"
#include "context.h"
+#include "imports.h"
#include "mtypes.h"
#include "state.h"
-/* $Id: attrib.c,v 1.74 2002/10/17 22:26:06 kschultz Exp $ */
+/* $Id: attrib.c,v 1.75 2002/10/24 23:57:19 brianp Exp $ */
/*
* Mesa 3-D graphics library
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
+#include "imports.h"
#include "accum.h"
#include "attrib.h"
#include "blend.h"
#include "light.h"
#include "lines.h"
#include "matrix.h"
-#include "mem.h"
#include "points.h"
#include "polygon.h"
#include "simple_list.h"
#include "texstate.h"
#include "mtypes.h"
#include "math/m_xform.h"
-#endif
-
-
/*
-/* $Id: blend.c,v 1.37 2002/10/04 19:10:07 brianp Exp $ */
+/* $Id: blend.c,v 1.38 2002/10/24 23:57:19 brianp Exp $ */
/*
* Mesa 3-D graphics library
*/
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
#include "blend.h"
#include "colormac.h"
#include "enums.h"
#include "macros.h"
#include "mtypes.h"
-#endif
void
-/* $Id: buffers.c,v 1.41 2002/10/11 17:41:03 brianp Exp $ */
+/* $Id: buffers.c,v 1.42 2002/10/24 23:57:19 brianp Exp $ */
/*
* Mesa 3-D graphics library
*/
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
+#include "imports.h"
#include "accum.h"
#include "buffers.h"
#include "colormac.h"
#include "depth.h"
#include "enums.h"
#include "macros.h"
-#include "mem.h"
#include "stencil.h"
#include "state.h"
#include "mtypes.h"
-#endif
-/* $Id: clip.c,v 1.25 2002/03/29 17:29:12 brianp Exp $ */
+/* $Id: clip.c,v 1.26 2002/10/24 23:57:19 brianp Exp $ */
/*
* Mesa 3-D graphics library
*/
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
#include "clip.h"
#include "context.h"
#include "math/m_xform.h"
#include "math/m_matrix.h"
-#endif
-/* $Id: colortab.c,v 1.45 2002/07/09 01:22:50 brianp Exp $ */
+/* $Id: colortab.c,v 1.46 2002/10/24 23:57:19 brianp Exp $ */
/*
* Mesa 3-D graphics library
*/
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
+#include "imports.h"
#include "colortab.h"
#include "context.h"
#include "image.h"
#include "macros.h"
-#include "mem.h"
#include "mmath.h"
#include "state.h"
-#endif
-
/*
-/* $Id: context.c,v 1.185 2002/10/16 17:57:51 brianp Exp $ */
+/* $Id: context.c,v 1.186 2002/10/24 23:57:20 brianp Exp $ */
/*
* Mesa 3-D graphics library
*/
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
+#include "imports.h"
#include "buffers.h"
#include "clip.h"
#include "colortab.h"
#include "hash.h"
#include "light.h"
#include "macros.h"
-#include "mem.h"
#include "mmath.h"
#include "simple_list.h"
#include "state.h"
#include "math/m_matrix.h"
#include "math/m_xform.h"
#include "math/mathmod.h"
-#endif
+
#if defined(MESA_TRACE)
#include "Trace/tr_context.h"
{
if (gc) {
_mesa_free_context_data(gc);
- (*gc->imports.free)(gc, gc);
+ _mesa_free(gc);
}
return GL_TRUE;
}
return NULL;
}
+ _mesa_initialize_context(ctx, modes, NULL, imports, GL_FALSE);
ctx->imports = *imports;
- _mesa_init_default_exports(&(ctx->exports));
- _mesa_initialize_context(ctx, modes, NULL, imports);
return ctx;
}
#ifdef USE_SPARC_ASM
_mesa_init_sparc_glapi_relocs();
#endif
- if ((*ctx->imports.getenv)(ctx, "MESA_DEBUG")) {
+ if (_mesa_getenv("MESA_DEBUG")) {
_glapi_noop_enable_warnings(GL_TRUE);
#ifndef GLX_DIRECT_RENDERING
/* libGL from before 2002/06/28 don't have this function. Someday,
ctx->_Facing = 0;
/* For debug/development only */
- ctx->NoRaster = (*ctx->imports.getenv)(ctx, "MESA_NO_RASTER") ? GL_TRUE : GL_FALSE;
+ ctx->NoRaster = _mesa_getenv("MESA_NO_RASTER") ? GL_TRUE : GL_FALSE;
ctx->FirstTimeCurrent = GL_TRUE;
/* Dither disable */
- ctx->NoDither = (*ctx->imports.getenv)(ctx, "MESA_NO_DITHER") ? GL_TRUE : GL_FALSE;
+ ctx->NoDither = _mesa_getenv("MESA_NO_DITHER") ? GL_TRUE : GL_FALSE;
if (ctx->NoDither) {
- if ((*ctx->imports.getenv)(ctx, "MESA_DEBUG")) {
+ if (_mesa_getenv("MESA_DEBUG")) {
_mesa_debug(ctx, "MESA_NO_DITHER set - dithering disabled\n");
}
ctx->Color.DitherFlag = GL_FALSE;
static void add_debug_flags( const char *debug )
{
#ifdef MESA_DEBUG
- if (strstr(debug, "varray"))
+ if (_mesa_strstr(debug, "varray"))
MESA_VERBOSE |= VERBOSE_VARRAY;
- if (strstr(debug, "tex"))
+ if (_mesa_strstr(debug, "tex"))
MESA_VERBOSE |= VERBOSE_TEXTURE;
- if (strstr(debug, "imm"))
+ if (_mesa_strstr(debug, "imm"))
MESA_VERBOSE |= VERBOSE_IMMEDIATE;
- if (strstr(debug, "pipe"))
+ if (_mesa_strstr(debug, "pipe"))
MESA_VERBOSE |= VERBOSE_PIPELINE;
- if (strstr(debug, "driver"))
+ if (_mesa_strstr(debug, "driver"))
MESA_VERBOSE |= VERBOSE_DRIVER;
- if (strstr(debug, "state"))
+ if (_mesa_strstr(debug, "state"))
MESA_VERBOSE |= VERBOSE_STATE;
- if (strstr(debug, "api"))
+ if (_mesa_strstr(debug, "api"))
MESA_VERBOSE |= VERBOSE_API;
- if (strstr(debug, "list"))
+ if (_mesa_strstr(debug, "list"))
MESA_VERBOSE |= VERBOSE_DISPLAY_LIST;
- if (strstr(debug, "lighting"))
+ if (_mesa_strstr(debug, "lighting"))
MESA_VERBOSE |= VERBOSE_LIGHTING;
/* Debug flag:
*/
- if (strstr(debug, "flush"))
+ if (_mesa_strstr(debug, "flush"))
MESA_DEBUG_FLAGS |= DEBUG_ALWAYS_FLUSH;
#endif
}
_mesa_initialize_context( GLcontext *ctx,
const GLvisual *visual,
GLcontext *share_list,
- const __GLimports *imports )
+ void *driver_ctx,
+ GLboolean direct )
{
GLuint dispatchSize;
const char *c;
- ASSERT(imports);
- ASSERT(imports->other); /* other points to the device driver's context */
+ ASSERT(driver_ctx);
- /* assing imports */
- ctx->imports = *imports;
+ /* If the driver wants core Mesa to use special imports, it'll have to
+ * override these defaults.
+ */
+ _mesa_init_default_imports( &(ctx->imports), driver_ctx );
/* initialize the exports (Mesa functions called by the window system) */
_mesa_init_default_exports( &(ctx->exports) );
/* misc one-time initializations */
one_time_init(ctx);
-#if 0
- /**
- ** OpenGL SI stuff
- **/
- if (!ctx->imports.malloc) {
- _mesa_init_default_imports(&ctx->imports, driver_ctx);
- }
- /* exports are setup by the device driver */
-#endif
-
- ctx->DriverCtx = imports->other;
+ ctx->DriverCtx = driver_ctx;
ctx->Visual = *visual;
ctx->DrawBuffer = NULL;
ctx->ReadBuffer = NULL;
}
ctx->MRD = 1.0; /* Minimum resolvable depth value, for polygon offset */
- c = (*ctx->imports.getenv)(ctx, "MESA_DEBUG");
+ c = _mesa_getenv("MESA_DEBUG");
if (c)
add_debug_flags(c);
- c = (*ctx->imports.getenv)(ctx, "MESA_VERBOSE");
+ c = _mesa_getenv("MESA_VERBOSE");
if (c)
add_debug_flags(c);
* Allocate and initialize a GLcontext structure.
* Input: visual - a GLvisual pointer (we copy the struct contents)
* sharelist - another context to share display lists with or NULL
- * imports - points to a fully-initialized __GLimports object.
+ * driver_ctx - pointer to device driver's context state struct
+ * direct - direct rendering?
* Return: pointer to a new __GLcontextRec or NULL if error.
*/
GLcontext *
_mesa_create_context( const GLvisual *visual,
GLcontext *share_list,
- const __GLimports *imports )
+ void *driver_ctx,
+ GLboolean direct )
+
{
GLcontext *ctx;
ASSERT(visual);
- ASSERT(imports);
- ASSERT(imports->calloc);
+ ASSERT(driver_ctx);
- ctx = (GLcontext *) (*imports->calloc)(NULL, 1, sizeof(GLcontext));
+ ctx = (GLcontext *) _mesa_calloc(sizeof(GLcontext));
if (!ctx)
return NULL;
- if (_mesa_initialize_context(ctx, visual, share_list, imports)) {
+ if (_mesa_initialize_context(ctx, visual, share_list, driver_ctx, direct)) {
return ctx;
}
else {
- (*imports->free)(NULL, ctx);
+ _mesa_free(ctx);
return NULL;
}
}
* information.
*/
if (newCtx->FirstTimeCurrent) {
- if ((*newCtx->imports.getenv)(newCtx, "MESA_INFO")) {
+ if (_mesa_getenv("MESA_INFO")) {
print_info();
}
newCtx->FirstTimeCurrent = GL_FALSE;
-/* $Id: context.h,v 1.34 2002/10/14 17:08:21 brianp Exp $ */
+/* $Id: context.h,v 1.35 2002/10/24 23:57:20 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "glapi.h"
#include "mtypes.h"
-#include "imports.h"
/*
extern GLcontext *
_mesa_create_context( const GLvisual *visual,
GLcontext *share_list,
- const __GLimports *imports );
+ void *driver_ctx,
+ GLboolean direct );
extern GLboolean
_mesa_initialize_context( GLcontext *ctx,
const GLvisual *visual,
GLcontext *share_list,
- const __GLimports *imports );
+ void *driver_ctx,
+ GLboolean direct );
extern void
_mesa_free_context_data( GLcontext *ctx );
-/* $Id: convolve.c,v 1.27 2002/07/09 01:22:50 brianp Exp $ */
+/* $Id: convolve.c,v 1.28 2002/10/24 23:57:20 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 4.0.2
+ * Version: 4.1
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
*/
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
#include "colormac.h"
#include "convolve.h"
#include "image.h"
#include "mtypes.h"
#include "state.h"
-#endif
/*
-/* $Id: debug.c,v 1.13 2002/06/29 19:48:15 brianp Exp $ */
+/* $Id: debug.c,v 1.14 2002/10/24 23:57:20 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "mtypes.h"
#include "context.h"
+#include "imports.h"
#include "debug.h"
-void _mesa_print_state( const char *msg, GLuint state )
+
+void
+_mesa_print_state( const char *msg, GLuint state )
{
_mesa_debug(NULL,
"%s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
-void _mesa_print_tri_caps( const char *name, GLuint flags )
+void
+_mesa_print_tri_caps( const char *name, GLuint flags )
{
_mesa_debug(NULL,
"%s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
-/* $Id: depth.c,v 1.30 2002/06/15 02:38:15 brianp Exp $ */
+/* $Id: depth.c,v 1.31 2002/10/24 23:57:20 brianp Exp $ */
/*
* Mesa 3-D graphics library
*/
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
+#include "imports.h"
#include "context.h"
#include "enums.h"
#include "depth.h"
#include "macros.h"
-#include "mem.h"
#include "mtypes.h"
-#endif
-
/**********************************************************************/
-/* $Id: dispatch.c,v 1.27 2002/06/29 19:48:15 brianp Exp $ */
+/* $Id: dispatch.c,v 1.28 2002/10/24 23:57:20 brianp Exp $ */
/*
* Mesa 3-D graphics library
*/
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
#include "glapi.h"
#include "glapitable.h"
#include "glthread.h"
-#endif
+
#if !(defined(USE_X86_ASM) || defined(USE_SPARC_ASM))
-/* $Id: dlist.c,v 1.98 2002/10/16 17:57:51 brianp Exp $ */
+/* $Id: dlist.c,v 1.99 2002/10/24 23:57:20 brianp Exp $ */
/*
* Mesa 3-D graphics library
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
+#include "imports.h"
#include "api_loopback.h"
#include "attrib.h"
#include "blend.h"
#include "dlist.h"
#include "macros.h"
#include "matrix.h"
-#include "mem.h"
#include "pixel.h"
#include "points.h"
#include "polygon.h"
#include "math/m_matrix.h"
#include "math/m_xform.h"
-#endif
-
/*
default:
{
char msg[1000];
- _mesa_sprintf( ctx, msg, "Error in execute_list: opcode=%d", (int) opcode);
- _mesa_problem( ctx, msg );
+ _mesa_sprintf(msg, "Error in execute_list: opcode=%d", (int) opcode);
+ _mesa_problem(ctx, msg);
}
done = GL_TRUE;
}
GLboolean done;
if (!glIsList(list)) {
- _mesa_printf(ctx, "%u is not a display list ID\n", list);
+ _mesa_printf("%u is not a display list ID\n", list);
return;
}
n = (Node *) _mesa_HashLookup(ctx->Shared->DisplayList, list);
- _mesa_printf(ctx, "START-LIST %u, address %p\n", list, (void*)n );
+ _mesa_printf("START-LIST %u, address %p\n", list, (void*)n );
done = n ? GL_FALSE : GL_TRUE;
while (!done) {
else {
switch (opcode) {
case OPCODE_ACCUM:
- _mesa_printf(ctx, "accum %s %g\n", enum_string(n[1].e), n[2].f );
+ _mesa_printf("accum %s %g\n", enum_string(n[1].e), n[2].f );
break;
case OPCODE_BITMAP:
- _mesa_printf(ctx, "Bitmap %d %d %g %g %g %g %p\n", n[1].i, n[2].i,
+ _mesa_printf("Bitmap %d %d %g %g %g %g %p\n", n[1].i, n[2].i,
n[3].f, n[4].f, n[5].f, n[6].f, (void *) n[7].data );
break;
case OPCODE_CALL_LIST:
- _mesa_printf(ctx, "CallList %d\n", (int) n[1].ui );
+ _mesa_printf("CallList %d\n", (int) n[1].ui );
break;
case OPCODE_CALL_LIST_OFFSET:
- _mesa_printf(ctx, "CallList %d + offset %u = %u\n", (int) n[1].ui,
+ _mesa_printf("CallList %d + offset %u = %u\n", (int) n[1].ui,
ctx->List.ListBase, ctx->List.ListBase + n[1].ui );
break;
case OPCODE_COLOR_TABLE_PARAMETER_FV:
- _mesa_printf(ctx, "ColorTableParameterfv %s %s %f %f %f %f\n",
+ _mesa_printf("ColorTableParameterfv %s %s %f %f %f %f\n",
enum_string(n[1].e), enum_string(n[2].e),
n[3].f, n[4].f, n[5].f, n[6].f);
break;
case OPCODE_COLOR_TABLE_PARAMETER_IV:
- _mesa_printf(ctx, "ColorTableParameteriv %s %s %d %d %d %d\n",
+ _mesa_printf("ColorTableParameteriv %s %s %d %d %d %d\n",
enum_string(n[1].e), enum_string(n[2].e),
n[3].i, n[4].i, n[5].i, n[6].i);
break;
case OPCODE_DISABLE:
- _mesa_printf(ctx, "Disable %s\n", enum_string(n[1].e));
+ _mesa_printf("Disable %s\n", enum_string(n[1].e));
break;
case OPCODE_ENABLE:
- _mesa_printf(ctx, "Enable %s\n", enum_string(n[1].e));
+ _mesa_printf("Enable %s\n", enum_string(n[1].e));
break;
case OPCODE_FRUSTUM:
- _mesa_printf(ctx, "Frustum %g %g %g %g %g %g\n",
+ _mesa_printf("Frustum %g %g %g %g %g %g\n",
n[1].f, n[2].f, n[3].f, n[4].f, n[5].f, n[6].f );
break;
case OPCODE_LINE_STIPPLE:
- _mesa_printf(ctx, "LineStipple %d %x\n", n[1].i, (int) n[2].us );
+ _mesa_printf("LineStipple %d %x\n", n[1].i, (int) n[2].us );
break;
case OPCODE_LOAD_IDENTITY:
- _mesa_printf(ctx, "LoadIdentity\n");
+ _mesa_printf("LoadIdentity\n");
break;
case OPCODE_LOAD_MATRIX:
- _mesa_printf(ctx, "LoadMatrix\n");
- _mesa_printf(ctx, " %8f %8f %8f %8f\n",
+ _mesa_printf("LoadMatrix\n");
+ _mesa_printf(" %8f %8f %8f %8f\n",
n[1].f, n[5].f, n[9].f, n[13].f);
- _mesa_printf(ctx, " %8f %8f %8f %8f\n",
+ _mesa_printf(" %8f %8f %8f %8f\n",
n[2].f, n[6].f, n[10].f, n[14].f);
- _mesa_printf(ctx, " %8f %8f %8f %8f\n",
+ _mesa_printf(" %8f %8f %8f %8f\n",
n[3].f, n[7].f, n[11].f, n[15].f);
- _mesa_printf(ctx, " %8f %8f %8f %8f\n",
+ _mesa_printf(" %8f %8f %8f %8f\n",
n[4].f, n[8].f, n[12].f, n[16].f);
break;
case OPCODE_MULT_MATRIX:
- _mesa_printf(ctx, "MultMatrix (or Rotate)\n");
- _mesa_printf(ctx, " %8f %8f %8f %8f\n",
+ _mesa_printf("MultMatrix (or Rotate)\n");
+ _mesa_printf(" %8f %8f %8f %8f\n",
n[1].f, n[5].f, n[9].f, n[13].f);
- _mesa_printf(ctx, " %8f %8f %8f %8f\n",
+ _mesa_printf(" %8f %8f %8f %8f\n",
n[2].f, n[6].f, n[10].f, n[14].f);
- _mesa_printf(ctx, " %8f %8f %8f %8f\n",
+ _mesa_printf(" %8f %8f %8f %8f\n",
n[3].f, n[7].f, n[11].f, n[15].f);
- _mesa_printf(ctx, " %8f %8f %8f %8f\n",
+ _mesa_printf(" %8f %8f %8f %8f\n",
n[4].f, n[8].f, n[12].f, n[16].f);
break;
case OPCODE_ORTHO:
- _mesa_printf(ctx, "Ortho %g %g %g %g %g %g\n",
+ _mesa_printf("Ortho %g %g %g %g %g %g\n",
n[1].f, n[2].f, n[3].f, n[4].f, n[5].f, n[6].f );
break;
case OPCODE_POP_ATTRIB:
- _mesa_printf(ctx, "PopAttrib\n");
+ _mesa_printf("PopAttrib\n");
break;
case OPCODE_POP_MATRIX:
- _mesa_printf(ctx, "PopMatrix\n");
+ _mesa_printf("PopMatrix\n");
break;
case OPCODE_POP_NAME:
- _mesa_printf(ctx, "PopName\n");
+ _mesa_printf("PopName\n");
break;
case OPCODE_PUSH_ATTRIB:
- _mesa_printf(ctx, "PushAttrib %x\n", n[1].bf );
+ _mesa_printf("PushAttrib %x\n", n[1].bf );
break;
case OPCODE_PUSH_MATRIX:
- _mesa_printf(ctx, "PushMatrix\n");
+ _mesa_printf("PushMatrix\n");
break;
case OPCODE_PUSH_NAME:
- _mesa_printf(ctx, "PushName %d\n", (int) n[1].ui );
+ _mesa_printf("PushName %d\n", (int) n[1].ui );
break;
case OPCODE_RASTER_POS:
- _mesa_printf(ctx, "RasterPos %g %g %g %g\n",
+ _mesa_printf("RasterPos %g %g %g %g\n",
n[1].f, n[2].f,n[3].f,n[4].f);
break;
case OPCODE_ROTATE:
- _mesa_printf(ctx, "Rotate %g %g %g %g\n",
+ _mesa_printf("Rotate %g %g %g %g\n",
n[1].f, n[2].f, n[3].f, n[4].f );
break;
case OPCODE_SCALE:
- _mesa_printf(ctx, "Scale %g %g %g\n", n[1].f, n[2].f, n[3].f );
+ _mesa_printf("Scale %g %g %g\n", n[1].f, n[2].f, n[3].f );
break;
case OPCODE_TRANSLATE:
- _mesa_printf(ctx, "Translate %g %g %g\n", n[1].f, n[2].f, n[3].f );
+ _mesa_printf("Translate %g %g %g\n", n[1].f, n[2].f, n[3].f );
break;
case OPCODE_BIND_TEXTURE:
- _mesa_printf(ctx, "BindTexture %s %d\n",
+ _mesa_printf("BindTexture %s %d\n",
_mesa_lookup_enum_by_nr(n[1].ui), n[2].ui);
break;
case OPCODE_SHADE_MODEL:
- _mesa_printf(ctx, "ShadeModel %s\n",
+ _mesa_printf("ShadeModel %s\n",
_mesa_lookup_enum_by_nr(n[1].ui));
break;
case OPCODE_MAP1:
- _mesa_printf(ctx, "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(ctx, "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);
break;
case OPCODE_MAPGRID1:
- _mesa_printf(ctx, "MapGrid1 %d %.3f %.3f\n",
+ _mesa_printf("MapGrid1 %d %.3f %.3f\n",
n[1].i, n[2].f, n[3].f);
break;
case OPCODE_MAPGRID2:
- _mesa_printf(ctx, "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;
case OPCODE_EVALMESH1:
- _mesa_printf(ctx, "EvalMesh1 %d %d\n", n[1].i, n[2].i);
+ _mesa_printf("EvalMesh1 %d %d\n", n[1].i, n[2].i);
break;
case OPCODE_EVALMESH2:
- _mesa_printf(ctx, "EvalMesh2 %d %d %d %d\n",
+ _mesa_printf("EvalMesh2 %d %d %d %d\n",
n[1].i, n[2].i, n[3].i, n[4].i);
break;
* meta opcodes/commands
*/
case OPCODE_ERROR:
- _mesa_printf(ctx, "Error: %s %s\n",
+ _mesa_printf("Error: %s %s\n",
enum_string(n[1].e), (const char *)n[2].data );
break;
case OPCODE_CONTINUE:
- _mesa_printf(ctx, "DISPLAY-LIST-CONTINUE\n");
+ _mesa_printf("DISPLAY-LIST-CONTINUE\n");
n = (Node *) n[1].next;
break;
case OPCODE_END_OF_LIST:
- _mesa_printf(ctx, "END-LIST %u\n", list);
+ _mesa_printf("END-LIST %u\n", list);
done = GL_TRUE;
break;
default:
if (opcode < 0 || opcode > OPCODE_END_OF_LIST) {
- _mesa_printf(ctx,
- "ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
- opcode, (void*) n);
+ _mesa_printf("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
+ opcode, (void*) n);
return;
}
else {
- _mesa_printf(ctx, "command %d, %u operands\n",
- opcode, InstSize[opcode]);
+ _mesa_printf("command %d, %u operands\n", opcode, InstSize[opcode]);
}
}
/* increment n to point to next compiled command */
-/* $Id: drawpix.c,v 1.62 2002/08/21 16:39:39 brianp Exp $ */
+/* $Id: drawpix.c,v 1.63 2002/10/24 23:57:20 brianp Exp $ */
/*
* Mesa 3-D graphics library
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
+#include "imports.h"
#include "colormac.h"
#include "context.h"
#include "drawpix.h"
#include "feedback.h"
#include "macros.h"
-#include "mem.h"
#include "mmath.h"
#include "state.h"
#include "mtypes.h"
-#endif
-
/*
-/* $Id: enable.c,v 1.70 2002/10/16 17:57:51 brianp Exp $ */
+/* $Id: enable.c,v 1.71 2002/10/24 23:57:20 brianp Exp $ */
/*
* Mesa 3-D graphics library
*/
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
#include "context.h"
#include "enable.h"
#include "enums.h"
#include "math/m_matrix.h"
#include "math/m_xform.h"
-#endif
+
#define CHECK_EXTENSION(EXTNAME, CAP) \
-/* $Id: enums.c,v 1.21 2002/06/29 19:48:15 brianp Exp $ */
+/* $Id: enums.c,v 1.22 2002/10/24 23:57:20 brianp Exp $ */
/*
* Mesa 3-D graphics library
*/
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
#include "enums.h"
#include "imports.h"
-#include "mem.h"
-#endif
typedef struct {
}
else {
/* this isn't re-entrant safe, no big deal here */
- _mesa_sprintf(NULL, token_tmp, "0x%x", nr);
+ _mesa_sprintf(token_tmp, "0x%x", nr);
return token_tmp;
}
}
-/* $Id: eval.c,v 1.23 2002/01/05 21:58:42 brianp Exp $ */
+/* $Id: eval.c,v 1.24 2002/10/24 23:57:20 brianp Exp $ */
/*
* Mesa 3-D graphics library
*/
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
+#include "imports.h"
#include "colormac.h"
#include "context.h"
#include "eval.h"
#include "macros.h"
-#include "mem.h"
#include "mmath.h"
#include "mtypes.h"
-#endif
/*
-/* $Id: extensions.c,v 1.83 2002/10/21 15:52:34 brianp Exp $ */
+/* $Id: extensions.c,v 1.84 2002/10/24 23:57:20 brianp Exp $ */
/*
* Mesa 3-D graphics library
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
+#include "imports.h"
#include "context.h"
#include "extensions.h"
-#include "mem.h"
#include "simple_list.h"
#include "mtypes.h"
-#endif
#define MAX_EXT_NAMELEN 80
-/* $Id: feedback.c,v 1.26 2002/06/15 02:54:01 brianp Exp $ */
+/* $Id: feedback.c,v 1.27 2002/10/24 23:57:20 brianp Exp $ */
/*
* Mesa 3-D graphics library
*/
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
#include "colormac.h"
#include "context.h"
#include "macros.h"
#include "mmath.h"
#include "mtypes.h"
-#endif
-/* $Id: fog.c,v 1.35 2001/05/30 14:43:17 brianp Exp $ */
+/* $Id: fog.c,v 1.36 2002/10/24 23:57:20 brianp Exp $ */
/*
* Mesa 3-D graphics library
*/
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
#include "colormac.h"
#include "context.h"
#include "fog.h"
#include "mtypes.h"
-#endif
-/* $Id: get.c,v 1.96 2002/10/16 17:57:52 brianp Exp $ */
+/* $Id: get.c,v 1.97 2002/10/24 23:57:20 brianp Exp $ */
/*
* Mesa 3-D graphics library
*/
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
#include "colormac.h"
#include "context.h"
#include "mtypes.h"
#include "texcompress.h"
#include "math/m_matrix.h"
-#endif
-/* $Id: hash.c,v 1.13 2002/09/16 17:55:36 brianp Exp $ */
+/* $Id: hash.c,v 1.14 2002/10/24 23:57:21 brianp Exp $ */
/*
* Mesa 3-D graphics library
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
+#include "imports.h"
#include "glthread.h"
#include "hash.h"
#include "context.h"
-#include "mem.h"
-#endif
/**
-/* $Id: hint.c,v 1.13 2002/06/15 02:54:02 brianp Exp $ */
+/* $Id: hint.c,v 1.14 2002/10/24 23:57:21 brianp Exp $ */
/*
* Mesa 3-D graphics library
*/
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
#include "enums.h"
#include "context.h"
#include "hint.h"
-#include "state.h"
-#endif
+#include "imports.h"
-/* $Id: histogram.c,v 1.10 2001/03/12 00:48:38 gareth Exp $ */
+/* $Id: histogram.c,v 1.11 2002/10/24 23:57:21 brianp Exp $ */
/*
* Mesa 3-D graphics library
*/
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
#include "colormac.h"
#include "context.h"
#include "image.h"
#include "histogram.h"
#include "mmath.h"
-#endif
/*
-/* $Id: histogram.h,v 1.3 2001/03/12 00:48:38 gareth Exp $ */
+/* $Id: histogram.h,v 1.4 2002/10/24 23:57:21 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2002 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"),
#ifndef HISTOGRAM_H
#define HISTOGRAM_H
-
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
#include "mtypes.h"
-#endif
-
extern void _mesa_GetMinmax(GLenum target, GLboolean reset, GLenum format, GLenum types, GLvoid *values);
-/* $Id: image.c,v 1.68 2002/09/21 17:34:56 brianp Exp $ */
+/* $Id: image.c,v 1.69 2002/10/24 23:57:21 brianp Exp $ */
/*
* Mesa 3-D graphics library
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
#include "colormac.h"
#include "context.h"
#include "image.h"
+#include "imports.h"
#include "histogram.h"
#include "macros.h"
-#include "mem.h"
#include "mmath.h"
#include "pixel.h"
#include "mtypes.h"
-#endif
-
/*
-/* $Id: imports.c,v 1.20 2002/10/15 15:36:26 brianp Exp $ */
+/* $Id: imports.c,v 1.21 2002/10/24 23:57:21 brianp Exp $ */
/*
* Mesa 3-D graphics library
* etc.
*
* Some drivers will want to override/replace this file with something
- * specialized, but most Mesa drivers will be able to call
- *_mesa_init_default_imports() and go with what's here.
+ * specialized, but that'll be rare.
*
- * Eventually, I'd like to move most of the stuff in glheader.h and mem.[ch]
- * into imports.[ch]. Then we'll really have one, single place where
- * all OS-related dependencies are isolated.
+ * Eventually, I want to move roll the glheader.h file into this.
+ *
+ * The OpenGL SI's __GLimports structure allows per-context specification of
+ * replacements for the standard C lib functions. In practice that's probably
+ * never needed; compile-time replacements are far more likely.
+ *
+ * The _mesa_foo() functions defined here don't in general take a context
+ * parameter. I guess we can change that someday, if need be.
+ * So for now, the __GLimports stuff really isn't used.
*/
#include "mtypes.h"
#include "context.h"
#include "imports.h"
-#include "mem.h"
+
#define MAXSTRING 4000 /* for vsnprintf() */
#define vsnprintf _vsnprintf
#endif
-static void *
-_mesa_Malloc(__GLcontext *gc, size_t size)
+
+/**********************************************************************/
+/* Wrappers for standard C library functions */
+/**********************************************************************/
+
+
+void *
+_mesa_malloc(size_t bytes)
{
- return MALLOC(size);
+#ifdef XFree86LOADER
+ return xf86malloc(bytes);
+#else
+ return malloc(bytes);
+#endif
}
-static void *
-_mesa_Calloc(__GLcontext *gc, size_t numElem, size_t elemSize)
+
+void *
+_mesa_calloc(size_t bytes)
{
- return CALLOC(numElem * elemSize);
+#ifdef XFree86LOADER
+ return xf86calloc(1, bytes);
+#else
+ return calloc(1, bytes);
+#endif
}
-static void *
-_mesa_Realloc(__GLcontext *gc, void *oldAddr, size_t newSize)
+
+void
+_mesa_free(void *ptr)
{
- return realloc(oldAddr, newSize);
+#ifdef XFree86LOADER
+ xf86free(ptr);
+#else
+ free(ptr);
+#endif
}
-static void
-_mesa_Free(__GLcontext *gc, void *addr)
+
+void *
+_mesa_align_malloc(size_t bytes, unsigned long alignment)
+{
+ unsigned long ptr, buf;
+
+ ASSERT( alignment > 0 );
+
+ ptr = (unsigned long) _mesa_malloc( bytes + alignment );
+
+ buf = (ptr + alignment) & ~(unsigned long)(alignment - 1);
+ *(unsigned long *)(buf - sizeof(void *)) = ptr;
+
+#ifdef DEBUG
+ /* mark the non-aligned area */
+ while ( ptr < buf - sizeof(void *) ) {
+ *(unsigned long *)ptr = 0xcdcdcdcd;
+ ptr += sizeof(unsigned long);
+ }
+#endif
+
+ return (void *)buf;
+}
+
+
+void *
+_mesa_align_calloc(size_t bytes, unsigned long alignment)
{
- FREE(addr);
+ unsigned long ptr, buf;
+
+ ASSERT( alignment > 0 );
+
+ ptr = (unsigned long) _mesa_calloc( bytes + alignment );
+
+ buf = (ptr + alignment) & ~(unsigned long)(alignment - 1);
+ *(unsigned long *)(buf - sizeof(void *)) = ptr;
+
+#ifdef DEBUG
+ /* mark the non-aligned area */
+ while ( ptr < buf - sizeof(void *) ) {
+ *(unsigned long *)ptr = 0xcdcdcdcd;
+ ptr += sizeof(unsigned long);
+ }
+#endif
+
+ return (void *)buf;
}
-/* Must be before '#undef getenv' for inclusion in XFree86.
- */
-char * CAPI
-_mesa_getenv(__GLcontext *gc, const char *var)
+void
+_mesa_align_free(void *ptr)
+{
+#if 0
+ _mesa_free( (void *)(*(unsigned long *)((unsigned long)ptr - sizeof(void *))) );
+#else
+ /* The actuall address to free is stuffed in the word immediately
+ * before the address the client sees.
+ */
+ void **cubbyHole = (void **) ((char *) ptr - sizeof(void *));
+ void *realAddr = *cubbyHole;
+ _mesa_free(realAddr);
+#endif
+}
+
+
+void *
+_mesa_memcpy(void *dest, const void *src, size_t n)
{
- (void) gc;
#ifdef XFree86LOADER
- return xf86getenv(var);
+ return xf86memcpy(dest, src, n);
+#elif defined(SUNOS4)
+ return memcpy((char *) dest, (char *) src, (int) n);
#else
- return getenv(var);
+ return memcpy(dest, src, n);
#endif
}
-static void
-warning(__GLcontext *gc, char *str)
+void
+_mesa_memset( void *dst, int val, size_t n )
{
- GLboolean debug;
-#ifdef DEBUG
- debug = GL_TRUE;
+#ifdef XFree86LOADER
+ xf86memset( dst, val, n );
+#elif defined(SUNOS4)
+ memset( (char *) dst, (int) val, (int) n );
#else
- if (_mesa_getenv(gc , "MESA_DEBUG"))
- debug = GL_TRUE;
- else
- debug = GL_FALSE;
+ memset(dst, val, n);
#endif
- if (debug) {
- fprintf(stderr, "Mesa warning: %s\n", str);
- }
}
void
-_mesa_fatal(__GLcontext *gc, char *str)
+_mesa_memset16( unsigned short *dst, unsigned short val, size_t n )
{
- (void) gc;
- fprintf(stderr, "%s\n", str);
- abort();
+ while (n-- > 0)
+ *dst++ = val;
}
-static int CAPI
-_mesa_atoi(__GLcontext *gc, const char *str)
+void
+_mesa_bzero( void *dst, size_t n )
{
- (void) gc;
- return atoi(str);
+#ifdef XFree86LOADER
+ xf86memset( dst, 0, n );
+#elif defined(__FreeBSD__)
+ bzero( dst, n );
+#else
+ memset( dst, 0, n );
+#endif
}
-int CAPI
-_mesa_sprintf(__GLcontext *gc, char *str, const char *fmt, ...)
+char *
+_mesa_getenv( const char *var )
{
- int r;
- va_list args;
- va_start( args, fmt );
- r = vsprintf( str, fmt, args );
- va_end( args );
- return r;
+#ifdef XFree86LOADER
+ return xf86getenv(var);
+#else
+ return getenv(var);
+#endif
}
-void * CAPI
-_mesa_fopen(__GLcontext *gc, const char *path, const char *mode)
+char *
+_mesa_strstr( const char *haystack, const char *needle )
{
- return fopen(path, mode);
+#ifdef XFree86LOADER
+ return xf86strstr(haystack, needle);
+#else
+ return strstr(haystack, needle);
+#endif
}
-int CAPI
-_mesa_fclose(__GLcontext *gc, void *stream)
+int
+_mesa_atoi(const char *s)
{
- return fclose((FILE *) stream);
+#ifdef XFree86LOADER
+ return xf86atoi(s);
+#else
+ return atoi(s);
+#endif
}
-int CAPI
-_mesa_fprintf(__GLcontext *gc, void *stream, const char *fmt, ...)
+int
+_mesa_sprintf( char *str, const char *fmt, ... )
{
int r;
va_list args;
va_start( args, fmt );
- r = vfprintf( (FILE *) stream, fmt, args );
va_end( args );
+#ifdef XFree86LOADER
+ r = xf86vsprintf( str, fmt, args );
+#else
+ r = vsprintf( str, fmt, args );
+#endif
return r;
}
-/* XXX this really is driver-specific and can't be here */
-static __GLdrawablePrivate *
-_mesa_GetDrawablePrivate(__GLcontext *gc)
+void
+_mesa_printf( const char *fmtString, ... )
{
- return NULL;
+ char s[MAXSTRING];
+ va_list args;
+ va_start( args, fmtString );
+ vsnprintf(s, MAXSTRING, fmtString, args);
+ va_end( args );
+#ifdef XFree86LOADER
+ xf86printf("%s", s);
+#else
+ printf("%s", s);
+#endif
}
-
void
-_mesa_warning(__GLcontext *gc, const char *fmtString, ...)
+_mesa_warning( GLcontext *ctx, const char *fmtString, ... )
{
+ GLboolean debug;
char str[MAXSTRING];
va_list args;
+ (void) ctx;
va_start( args, fmtString );
(void) vsnprintf( str, MAXSTRING, fmtString, args );
va_end( args );
- warning(gc, str);
+#ifdef DEBUG
+ debug = GL_TRUE; /* always print warning */
+#else
+ debug = _mesa_getenv("MESA_DEBUG") ? GL_TRUE : GL_FALSE;
+#endif
+ if (debug) {
+#ifdef XFree86LOADER
+ xf86fprintf(stderr, "Mesa warning: %s\n", str);
+#else
+ fprintf(stderr, "Mesa warning: %s\n", str);
+#endif
+ }
}
void
_mesa_problem( const GLcontext *ctx, const char *s )
{
- if (ctx) {
- ctx->imports.fprintf((GLcontext *) ctx, stderr, "Mesa implementation error: %s\n", s);
-#ifdef XF86DRI
- ctx->imports.fprintf((GLcontext *) ctx, stderr, "Please report to the DRI bug database at dri.sourceforge.net\n");
-#else
- ctx->imports.fprintf((GLcontext *) ctx, stderr, "Please report to the Mesa bug database at www.mesa3d.org\n" );
-#endif
- }
- else {
- /* what can we do if we don't have a context???? */
- fprintf( stderr, "Mesa implementation error: %s\n", s );
-#ifdef XF86DRI
- fprintf( stderr, "Please report to the DRI bug database at dri.sourceforge.net\n");
+ (void) ctx;
+#ifdef XFree86LOADER
+ xf86fprintf(stderr, "Mesa implementation error: %s\n", s);
+ xf86fprintf(stderr, "Please report to the DRI project at dri.sourceforge.net\n");
#else
- fprintf( stderr, "Please report to the Mesa bug database at www.mesa3d.org\n" );
+ fprintf(stderr, "Mesa implementation error: %s\n", s);
+ fprintf(stderr, "Please report to the Mesa bug database at www.mesa3d.org\n" );
#endif
- }
}
const char *debugEnv;
GLboolean debug;
- debugEnv = _mesa_getenv(ctx, "MESA_DEBUG");
+ debugEnv = _mesa_getenv("MESA_DEBUG");
#ifdef DEBUG
- if (debugEnv && strstr(debugEnv, "silent"))
+ if (debugEnv && _mesa_strstr(debugEnv, "silent"))
debug = GL_FALSE;
else
debug = GL_TRUE;
va_list args;
va_start(args, fmtString);
vsnprintf(s, MAXSTRING, fmtString, args);
- if (ctx)
- (void) ctx->imports.fprintf( (__GLcontext *) ctx, stderr, s );
- else
- fprintf( stderr, s );
va_end(args);
+#ifdef XFree86LOADER
+ xf86fprintf(stderr, "Mesa: %s", s);
+#else
+ fprintf(stderr, "Mesa: %s", s);
+#endif
}
-/*
- * A wrapper for printf. Uses stdout.
- */
-void
-_mesa_printf( const GLcontext *ctx, const char *fmtString, ... )
+
+/**********************************************************************/
+/* Default Imports Wrapper */
+/**********************************************************************/
+
+static void *
+default_malloc(__GLcontext *gc, size_t size)
{
- char s[MAXSTRING];
+ (void) gc;
+ return _mesa_malloc(size);
+}
+
+static void *
+default_calloc(__GLcontext *gc, size_t numElem, size_t elemSize)
+{
+ (void) gc;
+ return _mesa_calloc(numElem * elemSize);
+}
+
+static void *
+default_realloc(__GLcontext *gc, void *oldAddr, size_t newSize)
+{
+ (void) gc;
+#ifdef XFree86LOADER
+ return xf86realloc(oldAddr, newSize);
+#else
+ return realloc(oldAddr, newSize);
+#endif
+}
+
+static void
+default_free(__GLcontext *gc, void *addr)
+{
+ (void) gc;
+ _mesa_free(addr);
+}
+
+static char * CAPI
+default_getenv( __GLcontext *gc, const char *var )
+{
+ (void) gc;
+ return _mesa_getenv(var);
+}
+
+static void
+default_warning(__GLcontext *gc, char *str)
+{
+ _mesa_warning(gc, str);
+}
+
+static void
+default_fatal(__GLcontext *gc, char *str)
+{
+ _mesa_problem(gc, str);
+ abort();
+}
+
+static int CAPI
+default_atoi(__GLcontext *gc, const char *str)
+{
+ (void) gc;
+ return atoi(str);
+}
+
+static int CAPI
+default_sprintf(__GLcontext *gc, char *str, const char *fmt, ...)
+{
+ int r;
va_list args;
- va_start( args, fmtString );
- vsnprintf(s, MAXSTRING, fmtString, args);
- if (ctx)
- (void) ctx->imports.fprintf( (__GLcontext *) ctx, stdout, s );
- else
- printf( s );
+ va_start( args, fmt );
+ r = vsprintf( str, fmt, args );
va_end( args );
+ return r;
}
+static void * CAPI
+default_fopen(__GLcontext *gc, const char *path, const char *mode)
+{
+ return fopen(path, mode);
+}
+
+static int CAPI
+default_fclose(__GLcontext *gc, void *stream)
+{
+ return fclose((FILE *) stream);
+}
+
+static int CAPI
+default_fprintf(__GLcontext *gc, void *stream, const char *fmt, ...)
+{
+ int r;
+ va_list args;
+ va_start( args, fmt );
+ r = vfprintf( (FILE *) stream, fmt, args );
+ va_end( args );
+ return r;
+}
+
+/* XXX this really is driver-specific and can't be here */
+static __GLdrawablePrivate *
+default_GetDrawablePrivate(__GLcontext *gc)
+{
+ return NULL;
+}
+
+
+
/*
* Initialize a __GLimports object to point to the functions in
void
_mesa_init_default_imports(__GLimports *imports, void *driverCtx)
{
- imports->malloc = _mesa_Malloc;
- imports->calloc = _mesa_Calloc;
- imports->realloc = _mesa_Realloc;
- imports->free = _mesa_Free;
- imports->warning = warning;
- imports->fatal = _mesa_fatal;
- imports->getenv = _mesa_getenv;
- imports->atoi = _mesa_atoi;
- imports->sprintf = _mesa_sprintf;
- imports->fopen = _mesa_fopen;
- imports->fclose = _mesa_fclose;
- imports->fprintf = _mesa_fprintf;
- imports->getDrawablePrivate = _mesa_GetDrawablePrivate;
+ imports->malloc = default_malloc;
+ imports->calloc = default_calloc;
+ imports->realloc = default_realloc;
+ imports->free = default_free;
+ imports->warning = default_warning;
+ imports->fatal = default_fatal;
+ imports->getenv = default_getenv; /* not used for now */
+ imports->atoi = default_atoi;
+ imports->sprintf = default_sprintf;
+ imports->fopen = default_fopen;
+ imports->fclose = default_fclose;
+ imports->fprintf = default_fprintf;
+ imports->getDrawablePrivate = default_GetDrawablePrivate;
imports->other = driverCtx;
}
-/* $Id: imports.h,v 1.5 2002/10/15 15:36:26 brianp Exp $ */
+/* $Id: imports.h,v 1.6 2002/10/24 23:57:21 brianp Exp $ */
/*
* Mesa 3-D graphics library
*/
+/*
+ * This file provides wrappers for all the standard C library functions
+ * like malloc, free, printf, getenv, etc.
+ */
+
+
#ifndef IMPORTS_H
#define IMPORTS_H
-#include "glheader.h"
+#define MALLOC(BYTES) _mesa_malloc(BYTES)
+#define CALLOC(BYTES) _mesa_calloc(BYTES)
+#define MALLOC_STRUCT(T) (struct T *) _mesa_malloc(sizeof(struct T))
+#define CALLOC_STRUCT(T) (struct T *) _mesa_calloc(sizeof(struct T))
+#define FREE(PTR) _mesa_free(PTR)
+
+#define ALIGN_MALLOC(BYTES, N) _mesa_align_malloc(BYTES, N)
+#define ALIGN_CALLOC(BYTES, N) _mesa_align_calloc(BYTES, N)
+#define ALIGN_MALLOC_STRUCT(T, N) (struct T *) _mesa_align_malloc(sizeof(struct T), N)
+#define ALIGN_CALLOC_STRUCT(T, N) (struct T *) _mesa_align_calloc(sizeof(struct T), N)
+#define ALIGN_FREE(PTR) _mesa_align_free(PTR)
+
+#define MEMCPY( DST, SRC, BYTES) _mesa_memcpy(DST, SRC, BYTES)
+#define MEMSET( DST, VAL, N ) _mesa_memset(DST, VAL, N)
+#define BZERO( ADDR, N ) _mesa_bzero(ADDR, N)
+
+
+/* MACs and BeOS don't support static larger than 32kb, so... */
+#if defined(macintosh) && !defined(__MRC__)
+/*extern char *AGLAlloc(int size);*/
+/*extern void AGLFree(char* ptr);*/
+# define DEFARRAY(TYPE,NAME,SIZE) TYPE *NAME = (TYPE*)_mesa_alloc(sizeof(TYPE)*(SIZE))
+# define DEFMARRAY(TYPE,NAME,SIZE1,SIZE2) TYPE (*NAME)[SIZE2] = (TYPE(*)[SIZE2])_mesa_alloc(sizeof(TYPE)*(SIZE1)*(SIZE2))
+# define DEFMNARRAY(TYPE,NAME,SIZE1,SIZE2,SIZE3) TYPE (*NAME)[SIZE2][SIZE3] = (TYPE(*)[SIZE2][SIZE3])_mesa_alloc(sizeof(TYPE)*(SIZE1)*(SIZE2)*(SIZE3))
+
+# define CHECKARRAY(NAME,CMD) do {if (!(NAME)) {CMD;}} while (0)
+# define UNDEFARRAY(NAME) do {if ((NAME)) {_mesa_free((char*)NAME);} }while (0)
+#elif defined(__BEOS__)
+# define DEFARRAY(TYPE,NAME,SIZE) TYPE *NAME = (TYPE*)_mesa_malloc(sizeof(TYPE)*(SIZE))
+# define DEFMARRAY(TYPE,NAME,SIZE1,SIZE2) TYPE (*NAME)[SIZE2] = (TYPE(*)[SIZE2])_mesa_malloc(sizeof(TYPE)*(SIZE1)*(SIZE2))
+# define DEFMNARRAY(TYPE,NAME,SIZE1,SIZE2,SIZE3) TYPE (*NAME)[SIZE2][SIZE3] = (TYPE(*)[SIZE2][SIZE3])_mesa_malloc(sizeof(TYPE)*(SIZE1)*(SIZE2)*(SIZE3))
+# define CHECKARRAY(NAME,CMD) do {if (!(NAME)) {CMD;}} while (0)
+# define UNDEFARRAY(NAME) do {if ((NAME)) {_mesa_free((char*)NAME);} }while (0)
+#else
+# define DEFARRAY(TYPE,NAME,SIZE) TYPE NAME[SIZE]
+# define DEFMARRAY(TYPE,NAME,SIZE1,SIZE2) TYPE NAME[SIZE1][SIZE2]
+# define DEFMNARRAY(TYPE,NAME,SIZE1,SIZE2,SIZE3) TYPE NAME[SIZE1][SIZE2][SIZE3]
+# define CHECKARRAY(NAME,CMD) do {} while(0)
+# define UNDEFARRAY(NAME)
+#endif
-extern int CAPI
-_mesa_sprintf(__GLcontext *gc, char *str, const char *fmt, ...);
+#ifdef MESA_EXTERNAL_BUFFERALLOC
+/*
+ * If you want Mesa's depth/stencil/accum/etc buffers to be allocated
+ * with a specialized allocator you can define MESA_EXTERNAL_BUFFERALLOC
+ * and implement _ext_mesa_alloc/free_pixelbuffer() in your app.
+ * Contributed by Gerk Huisma (gerk@five-d.demon.nl).
+ */
+extern void *_ext_mesa_alloc_pixelbuffer( unsigned int size );
+extern void _ext_mesa_free_pixelbuffer( void *pb );
+
+#define MESA_PBUFFER_ALLOC(BYTES) (void *) _ext_mesa_alloc_pixelbuffer(BYTES)
+#define MESA_PBUFFER_FREE(PTR) _ext_mesa_free_pixelbuffer(PTR)
+#else
+/* Default buffer allocation uses the aligned allocation routines: */
+#define MESA_PBUFFER_ALLOC(BYTES) (void *) _mesa_align_malloc(BYTES, 512)
+#define MESA_PBUFFER_FREE(PTR) _mesa_align_free(PTR)
+#endif
+
+
+extern void *
+_mesa_malloc( size_t bytes );
+
+extern void *
+_mesa_calloc( size_t bytes );
extern void
-_mesa_warning(__GLcontext *gc, const char *fmtString, ...);
+_mesa_free( void *ptr );
+
+extern void *
+_mesa_align_malloc( size_t bytes, unsigned long alignment );
+
+extern void *
+_mesa_align_calloc( size_t bytes, unsigned long alignment );
extern void
-_mesa_fatal(__GLcontext *gc, char *str);
+_mesa_align_free( void *ptr );
+
+extern void *
+_mesa_memcpy( void *dest, const void *src, size_t n );
extern void
-_mesa_problem( const __GLcontext *ctx, const char *s );
+_mesa_memset( void *dst, int val, size_t n );
extern void
-_mesa_error( __GLcontext *ctx, GLenum error, const char *fmtString, ... );
+_mesa_memset16( unsigned short *dst, unsigned short val, size_t n );
extern void
-_mesa_debug( const __GLcontext *ctx, const char *fmtString, ... );
+_mesa_bzero( void *dst, size_t n );
+
+
+extern char *
+_mesa_getenv( const char *var );
+
+extern char *
+_mesa_strstr( const char *haystack, const char *needle );
+
+extern int
+_mesa_atoi( const char *s );
+
+extern int
+_mesa_sprintf( char *str, const char *fmt, ... );
+
+extern void
+_mesa_printf( const char *fmtString, ... );
+
extern void
-_mesa_printf( const __GLcontext *ctx, const char *fmtString, ... );
+_mesa_warning( __GLcontext *gc, const char *fmtString, ... );
-extern int CAPI
-_mesa_fprintf(__GLcontext *gc, void *stream, const char *fmt, ...);
+extern void
+_mesa_problem( const __GLcontext *ctx, const char *s );
-extern void * CAPI
-_mesa_fopen(__GLcontext *gc, const char *path, const char *mode);
+extern void
+_mesa_error( __GLcontext *ctx, GLenum error, const char *fmtString, ... );
-extern int CAPI
-_mesa_fclose(__GLcontext *gc, void *stream);
+extern void
+_mesa_debug( const __GLcontext *ctx, const char *fmtString, ... );
-extern char * CAPI
-_mesa_getenv(__GLcontext *gc, const char *var);
extern void
-_mesa_init_default_imports(__GLimports *imports, void *driverCtx);
+_mesa_init_default_imports( __GLimports *imports, void *driverCtx );
-#endif
+#endif /* IMPORTS_H */
+
-/* $Id: light.c,v 1.52 2002/09/16 17:56:02 brianp Exp $ */
+/* $Id: light.c,v 1.53 2002/10/24 23:57:21 brianp Exp $ */
/*
* Mesa 3-D graphics library
*/
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
+#include "imports.h"
#include "colormac.h"
#include "context.h"
#include "enums.h"
#include "light.h"
#include "macros.h"
-#include "mem.h"
#include "mmath.h"
#include "simple_list.h"
#include "mtypes.h"
-
#include "math/m_xform.h"
#include "math/m_matrix.h"
-#endif
/* XXX this is a bit of a hack needed for compilation within XFree86 */
-/* $Id: lines.c,v 1.29 2001/03/12 00:48:38 gareth Exp $ */
+/* $Id: lines.c,v 1.30 2002/10/24 23:57:21 brianp Exp $ */
/*
* Mesa 3-D graphics library
*/
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
#include "context.h"
#include "depth.h"
#include "mmath.h"
#include "texstate.h"
#include "mtypes.h"
-#endif
-
void
-/* $Id: matrix.c,v 1.44 2002/08/21 16:39:39 brianp Exp $ */
+/* $Id: matrix.c,v 1.45 2002/10/24 23:57:21 brianp Exp $ */
/*
* Mesa 3-D graphics library
*/
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
+#include "imports.h"
#include "buffers.h"
#include "context.h"
#include "enums.h"
#include "macros.h"
#include "matrix.h"
-#include "mem.h"
#include "mmath.h"
#include "mtypes.h"
-
#include "math/m_matrix.h"
-#endif
+
void
-/* $Id: pixel.c,v 1.36 2002/09/21 17:34:56 brianp Exp $ */
+/* $Id: pixel.c,v 1.37 2002/10/24 23:57:21 brianp Exp $ */
/*
* Mesa 3-D graphics library
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
+#include "imports.h"
#include "colormac.h"
#include "context.h"
#include "macros.h"
-#include "mem.h"
#include "pixel.h"
#include "mtypes.h"
-#endif
-
/**********************************************************************/
-/* $Id: points.c,v 1.33 2002/05/27 17:04:53 brianp Exp $ */
+/* $Id: points.c,v 1.34 2002/10/24 23:57:21 brianp Exp $ */
/*
* Mesa 3-D graphics library
*/
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
#include "context.h"
#include "macros.h"
#include "points.h"
#include "texstate.h"
#include "mtypes.h"
-#endif
-/* $Id: polygon.c,v 1.24 2002/10/02 22:05:58 brianp Exp $ */
+/* $Id: polygon.c,v 1.25 2002/10/24 23:57:21 brianp Exp $ */
/*
* Mesa 3-D graphics library
*/
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
+#include "imports.h"
#include "context.h"
#include "image.h"
#include "enums.h"
#include "macros.h"
-#include "mem.h"
#include "polygon.h"
#include "mtypes.h"
-#endif
-
void
-/* $Id: rastpos.c,v 1.38 2002/05/27 17:03:08 brianp Exp $ */
+/* $Id: rastpos.c,v 1.39 2002/10/24 23:57:21 brianp Exp $ */
/*
* Mesa 3-D graphics library
*/
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
#include "clip.h"
#include "colormac.h"
#include "math/m_matrix.h"
#include "math/m_xform.h"
-#endif
/*
-/* $Id: state.c,v 1.95 2002/10/16 17:57:52 brianp Exp $ */
+/* $Id: state.c,v 1.96 2002/10/24 23:57:21 brianp Exp $ */
/*
* Mesa 3-D graphics library
*/
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
#include "accum.h"
#include "api_loopback.h"
#include "math/m_matrix.h"
#include "math/m_xform.h"
-#endif
static int
-/* $Id: stencil.c,v 1.28 2002/09/06 02:56:09 brianp Exp $ */
+/* $Id: stencil.c,v 1.29 2002/10/24 23:57:21 brianp Exp $ */
/*
* Mesa 3-D graphics library
*/
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
+#include "imports.h"
#include "context.h"
#include "depth.h"
#include "macros.h"
-#include "mem.h"
#include "stencil.h"
#include "mtypes.h"
#include "enable.h"
-#endif
-
-
void
-/* $Id: texcompress.c,v 1.2 2002/10/18 17:41:45 brianp Exp $ */
+/* $Id: texcompress.c,v 1.3 2002/10/24 23:57:21 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "glheader.h"
+#include "imports.h"
#include "context.h"
#include "image.h"
-#include "mem.h"
#include "texcompress.h"
#include "texformat.h"
-/* $Id: texformat.c,v 1.16 2002/09/27 02:45:38 brianp Exp $ */
+/* $Id: texformat.c,v 1.17 2002/10/24 23:57:21 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Gareth Hughes <gareth@valinux.com>
*/
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
#include "colormac.h"
#include "context.h"
#include "image.h"
-#include "mem.h"
+#include "imports.h"
#include "mmath.h"
#include "mtypes.h"
#include "texformat.h"
#include "teximage.h"
#include "texstate.h"
-#endif
/* Texel fetch routines for all supported formats:
-/* $Id: teximage.c,v 1.122 2002/10/18 18:03:04 brianp Exp $ */
+/* $Id: teximage.c,v 1.123 2002/10/24 23:57:21 brianp Exp $ */
/*
* Mesa 3-D graphics library
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
#include "context.h"
#include "convolve.h"
#include "image.h"
+#include "imports.h"
#include "macros.h"
-#include "mem.h"
#include "mmath.h"
#include "state.h"
#include "texcompress.h"
#include "texstate.h"
#include "texstore.h"
#include "mtypes.h"
-#endif
/*
const GLchan *data = (const GLchan *) img->Data;
if (!data) {
- _mesa_printf(ctx, "No texture data\n");
+ _mesa_printf("No texture data\n");
return;
}
for (i = 0; i < img->Height; i++) {
for (j = 0; j < img->Width; j++) {
if (c==1)
- _mesa_printf(ctx, "%02x ", data[0]);
+ _mesa_printf("%02x ", data[0]);
else if (c==2)
- _mesa_printf(ctx, "%02x%02x ", data[0], data[1]);
+ _mesa_printf("%02x%02x ", data[0], data[1]);
else if (c==3)
- _mesa_printf(ctx, "%02x%02x%02x ", data[0], data[1], data[2]);
+ _mesa_printf("%02x%02x%02x ", data[0], data[1], data[2]);
else if (c==4)
- _mesa_printf(ctx, "%02x%02x%02x%02x ", data[0], data[1], data[2], data[3]);
+ _mesa_printf("%02x%02x%02x%02x ", data[0], data[1], data[2], data[3]);
data += (img->RowStride - img->Width) * c;
}
- _mesa_printf(ctx, "\n");
+ _mesa_printf("\n");
}
#endif
}
-/* $Id: texobj.c,v 1.61 2002/10/22 15:15:41 brianp Exp $ */
+/* $Id: texobj.c,v 1.62 2002/10/24 23:57:21 brianp Exp $ */
/*
* Mesa 3-D graphics library
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
#include "colortab.h"
#include "context.h"
#include "enums.h"
#include "hash.h"
+#include "imports.h"
#include "macros.h"
-#include "mem.h"
#include "teximage.h"
#include "texstate.h"
#include "texobj.h"
#include "mtypes.h"
-#endif
-
/*
-/* $Id: texstate.c,v 1.83 2002/10/23 14:53:27 brianp Exp $ */
+/* $Id: texstate.c,v 1.84 2002/10/24 23:57:21 brianp Exp $ */
/*
* Mesa 3-D graphics library
*/
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
#include "colormac.h"
#include "context.h"
#include "mtypes.h"
#include "math/m_xform.h"
#include "math/m_matrix.h"
-#endif
-/* $Id: texstore.c,v 1.44 2002/10/18 18:03:08 brianp Exp $ */
+/* $Id: texstore.c,v 1.45 2002/10/24 23:57:21 brianp Exp $ */
/*
* Mesa 3-D graphics library
*/
-
+#include "glheader.h"
#include "colormac.h"
#include "context.h"
#include "convolve.h"
#include "image.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "texcompress.h"
#include "texformat.h"
#include "teximage.h"
-/* $Id: texutil.c,v 1.32 2002/09/27 02:45:38 brianp Exp $ */
+/* $Id: texutil.c,v 1.33 2002/10/24 23:57:21 brianp Exp $ */
/*
* Mesa 3-D graphics library
*/
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
#include "context.h"
#include "enums.h"
#include "image.h"
+#include "imports.h"
#include "macros.h"
-#include "mem.h"
#include "mtypes.h"
#include "texformat.h"
#include "texutil.h"
-#endif
+
#define DEBUG_TEXUTIL 0
-/* $Id: varray.c,v 1.46 2002/06/30 15:47:01 brianp Exp $ */
+/* $Id: varray.c,v 1.47 2002/10/24 23:57:21 brianp Exp $ */
/*
* Mesa 3-D graphics library
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
#include "context.h"
#include "enable.h"
#include "mtypes.h"
#include "varray.h"
#include "math/m_translate.h"
-#endif
-/* $Id: vtxfmt.c,v 1.12 2002/06/29 19:48:16 brianp Exp $ */
+/* $Id: vtxfmt.c,v 1.13 2002/10/24 23:57:21 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "glheader.h"
#include "api_loopback.h"
#include "context.h"
+#include "imports.h"
#include "mtypes.h"
#include "state.h"
#include "vtxfmt.h"
-/* $Id: m_debug_clip.c,v 1.2 2002/06/29 19:48:17 brianp Exp $ */
+/* $Id: m_debug_clip.c,v 1.3 2002/10/24 23:57:24 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "glheader.h"
#include "context.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "m_matrix.h"
#include "m_xform.h"
-/* $Id: m_debug_norm.c,v 1.9 2002/06/29 19:48:17 brianp Exp $ */
+/* $Id: m_debug_norm.c,v 1.10 2002/10/24 23:57:24 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "glheader.h"
#include "context.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "mmath.h"
#include "m_matrix.h"
-/* $Id: m_debug_xform.c,v 1.9 2002/06/29 19:48:17 brianp Exp $ */
+/* $Id: m_debug_xform.c,v 1.10 2002/10/24 23:57:24 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "glheader.h"
#include "context.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "m_matrix.h"
#include "m_xform.h"
-/* $Id: m_matrix.c,v 1.13 2002/09/12 16:26:04 brianp Exp $ */
+/* $Id: m_matrix.c,v 1.14 2002/10/24 23:57:24 brianp Exp $ */
/*
* Mesa 3-D graphics library
* 3. Transformation of a point p by a matrix M is: p' = M * p
*/
-#include <math.h>
-
#include "glheader.h"
#include "imports.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "mmath.h"
#include "m_matrix.h"
-/* $Id: m_norm_tmp.h,v 1.11 2002/04/09 14:58:04 keithw Exp $ */
+/* $Id: m_norm_tmp.h,v 1.12 2002/10/24 23:57:24 brianp Exp $ */
/*
* Mesa 3-D graphics library
* the transformation matrix, rescaling and normalization.
*/
-#include <math.h>
-
-
/*
* mat - the 4x4 transformation matrix
* scale - uniform scale factor of the transformation matrix (not always used)
-/* $Id: m_translate.c,v 1.9 2001/09/18 23:06:14 kschultz Exp $ */
+/* $Id: m_translate.c,v 1.10 2002/10/24 23:57:24 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2002 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 "mtypes.h" /* GLchan hack */
#include "colormac.h"
-#include "mem.h"
#include "mmath.h"
#include "m_translate.h"
-/* $Id: m_vector.c,v 1.7 2002/06/29 19:48:17 brianp Exp $ */
+/* $Id: m_vector.c,v 1.8 2002/10/24 23:57:24 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "glheader.h"
#include "imports.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "m_vector.h"
-/* $Id: m_xform.c,v 1.17 2002/07/10 01:25:50 brianp Exp $ */
+/* $Id: m_xform.c,v 1.18 2002/10/24 23:57:24 brianp Exp $ */
/*
* Mesa 3-D graphics library
* 3. Transformation of a point p by a matrix M is: p' = M * p
*/
-#include <math.h>
-
#include "glheader.h"
#include "macros.h"
#include "mmath.h"
-/* $Id: s_aatriangle.c,v 1.25 2002/10/18 17:02:01 kschultz Exp $ */
+/* $Id: s_aatriangle.c,v 1.26 2002/10/24 23:57:24 brianp Exp $ */
/*
* Mesa 3-D graphics library
*/
+#include "glheader.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "mmath.h"
#include "s_aatriangle.h"
#include "s_context.h"
-/* $Id: s_accum.c,v 1.18 2002/07/09 01:22:52 brianp Exp $ */
+/* $Id: s_accum.c,v 1.19 2002/10/24 23:57:24 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "context.h"
#include "macros.h"
#include "mmath.h"
-#include "mem.h"
+#include "imports.h"
#include "s_accum.h"
#include "s_alphabuf.h"
-/* $Id: s_alphabuf.c,v 1.14 2002/10/18 17:02:01 kschultz Exp $ */
+/* $Id: s_alphabuf.c,v 1.15 2002/10/24 23:57:24 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "glheader.h"
#include "context.h"
-#include "mem.h"
+#include "imports.h"
#include "s_context.h"
#include "s_alphabuf.h"
-/* $Id: s_buffers.c,v 1.14 2002/10/11 17:41:06 brianp Exp $ */
+/* $Id: s_buffers.c,v 1.15 2002/10/24 23:57:24 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "glheader.h"
#include "colormac.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "s_accum.h"
#include "s_alphabuf.h"
-/* $Id: s_context.c,v 1.40 2002/10/11 17:50:59 brianp Exp $ */
+/* $Id: s_context.c,v 1.41 2002/10/24 23:57:24 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "glheader.h"
#include "context.h"
#include "mtypes.h"
-#include "mem.h"
+#include "imports.h"
#include "swrast.h"
#include "s_blend.h"
-/* $Id: s_copypix.c,v 1.40 2002/08/07 00:45:07 brianp Exp $ */
+/* $Id: s_copypix.c,v 1.41 2002/10/24 23:57:24 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "convolve.h"
#include "feedback.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "mmath.h"
#include "pixel.h"
-/* $Id: s_depth.c,v 1.23 2002/08/07 00:45:07 brianp Exp $ */
+/* $Id: s_depth.c,v 1.24 2002/10/24 23:57:24 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "glheader.h"
#include "context.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "s_depth.h"
#include "s_context.h"
-/* $Id: s_drawpix.c,v 1.37 2002/10/08 23:59:34 brianp Exp $ */
+/* $Id: s_drawpix.c,v 1.38 2002/10/24 23:57:24 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "convolve.h"
#include "image.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "mmath.h"
#include "pixel.h"
-/* $Id: s_logic.c,v 1.11 2002/08/07 00:45:07 brianp Exp $ */
+/* $Id: s_logic.c,v 1.12 2002/10/24 23:57:24 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "glheader.h"
#include "context.h"
+#include "imports.h"
#include "macros.h"
#include "s_alphabuf.h"
-/* $Id: s_pixeltex.c,v 1.10 2002/08/07 00:45:07 brianp Exp $ */
+/* $Id: s_pixeltex.c,v 1.11 2002/10/24 23:57:24 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "glheader.h"
#include "colormac.h"
-#include "mem.h"
+#include "imports.h"
#include "s_context.h"
#include "s_pixeltex.h"
-/* $Id: s_readpix.c,v 1.16 2002/09/21 17:34:56 brianp Exp $ */
+/* $Id: s_readpix.c,v 1.17 2002/10/24 23:57:24 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "feedback.h"
#include "image.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "pixel.h"
#include "s_alphabuf.h"
-/* $Id: s_span.c,v 1.49 2002/10/11 17:41:06 brianp Exp $ */
+/* $Id: s_span.c,v 1.50 2002/10/24 23:57:24 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "context.h"
#include "macros.h"
#include "mmath.h"
-#include "mem.h"
+#include "imports.h"
#include "s_alpha.h"
#include "s_alphabuf.h"
-/* $Id: s_stencil.c,v 1.27 2002/10/02 23:24:04 brianp Exp $ */
+/* $Id: s_stencil.c,v 1.28 2002/10/24 23:57:24 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "glheader.h"
#include "context.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "s_context.h"
#include "s_depth.h"
-/* $Id: s_texstore.c,v 1.8 2002/09/27 02:45:39 brianp Exp $ */
+/* $Id: s_texstore.c,v 1.9 2002/10/24 23:57:24 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "context.h"
#include "convolve.h"
#include "image.h"
+#include "imports.h"
#include "macros.h"
-#include "mem.h"
#include "texformat.h"
#include "teximage.h"
#include "texstore.h"
-/* $Id: s_texture.c,v 1.72 2002/10/21 15:52:35 brianp Exp $ */
+/* $Id: s_texture.c,v 1.73 2002/10/24 23:57:24 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "colormac.h"
#include "macros.h"
#include "mmath.h"
-#include "mem.h"
+#include "imports.h"
#include "texformat.h"
#include "teximage.h"
-/* $Id: s_triangle.c,v 1.62 2002/09/23 16:37:15 brianp Exp $ */
+/* $Id: s_triangle.c,v 1.63 2002/10/24 23:57:24 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "glheader.h"
#include "context.h"
#include "colormac.h"
+#include "imports.h"
#include "macros.h"
-#include "mem.h"
#include "mmath.h"
#include "texformat.h"
#include "teximage.h"
-/* $Id: s_zoom.c,v 1.17 2002/08/07 00:45:07 brianp Exp $ */
+/* $Id: s_zoom.c,v 1.18 2002/10/24 23:57:24 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "glheader.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "colormac.h"
#include "s_context.h"
-/* $Id: ss_context.c,v 1.18 2002/10/04 17:37:47 brianp Exp $ */
+/* $Id: ss_context.c,v 1.19 2002/10/24 23:57:25 brianp Exp $ */
/*
* Mesa 3-D graphics library
*/
#include "glheader.h"
-#include "mem.h"
+#include "imports.h"
#include "ss_context.h"
#include "ss_triangle.h"
#include "ss_vb.h"
-/* $Id: ss_vb.c,v 1.20 2002/06/29 19:48:17 brianp Exp $ */
+/* $Id: ss_vb.c,v 1.21 2002/10/24 23:57:25 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "colormac.h"
#include "context.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "swrast/swrast.h"
#include "tnl/t_context.h"
-/* $Id: t_array_api.c,v 1.27 2002/06/29 19:48:17 brianp Exp $ */
+/* $Id: t_array_api.c,v 1.28 2002/10/24 23:57:25 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "glheader.h"
#include "api_validate.h"
#include "context.h"
+#include "imports.h"
#include "macros.h"
#include "mmath.h"
-#include "mem.h"
-#include "state.h"
#include "mtypes.h"
+#include "state.h"
#include "array_cache/acache.h"
-/* $Id: t_array_import.c,v 1.25 2002/06/29 19:48:17 brianp Exp $ */
+/* $Id: t_array_import.c,v 1.26 2002/10/24 23:57:25 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "glheader.h"
#include "context.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "mmath.h"
#include "state.h"
#include "mtypes.h"
-/* $Id: t_context.c,v 1.28 2002/08/21 13:05:37 brianp Exp $ */
+/* $Id: t_context.c,v 1.29 2002/10/24 23:57:25 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "glheader.h"
+#include "imports.h"
#include "macros.h"
#include "mtypes.h"
-#include "mem.h"
#include "dlist.h"
#include "light.h"
#include "vtxfmt.h"
-/* $Id: t_eval_api.c,v 1.11 2002/06/23 02:36:27 brianp Exp $ */
+/* $Id: t_eval_api.c,v 1.12 2002/10/24 23:57:25 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "colormac.h"
#include "context.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "mmath.h"
#include "mtypes.h"
#include "math/m_eval.h"
-/* $Id: t_imm_alloc.c,v 1.15 2002/04/19 12:32:14 brianp Exp $ */
+/* $Id: t_imm_alloc.c,v 1.16 2002/10/24 23:57:25 brianp Exp $ */
/*
* Mesa 3-D graphics library
*/
#include "glheader.h"
-#include "mem.h"
+#include "imports.h"
#include "mtypes.h"
#include "t_imm_alloc.h"
-/* $Id: t_imm_api.c,v 1.33 2002/10/09 19:38:32 brianp Exp $ */
+/* $Id: t_imm_api.c,v 1.34 2002/10/24 23:57:25 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "dlist.h"
#include "enums.h"
#include "light.h"
-#include "mem.h"
+#include "imports.h"
#include "state.h"
#include "colormac.h"
#include "macros.h"
-/* $Id: t_imm_debug.c,v 1.8 2002/06/29 19:48:17 brianp Exp $ */
+/* $Id: t_imm_debug.c,v 1.9 2002/10/24 23:57:25 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "mtypes.h"
#include "context.h"
+#include "imports.h"
#include "t_context.h"
#include "t_imm_debug.h"
+
void _tnl_print_vert_flags( const char *name, GLuint flags )
{
_mesa_debug(NULL,
-/* $Id: t_imm_dlist.c,v 1.42 2002/06/15 02:38:18 brianp Exp $ */
+/* $Id: t_imm_dlist.c,v 1.43 2002/10/24 23:57:25 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "dlist.h"
#include "debug.h"
#include "mmath.h"
-#include "mem.h"
+#include "imports.h"
#include "state.h"
#include "t_context.h"
-/* $Id: t_imm_elt.c,v 1.18 2002/06/15 02:38:18 brianp Exp $ */
+/* $Id: t_imm_elt.c,v 1.19 2002/10/24 23:57:25 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "glheader.h"
#include "colormac.h"
#include "context.h"
-#include "mem.h"
+#include "imports.h"
#include "mmath.h"
#include "mtypes.h"
-/* $Id: t_imm_eval.c,v 1.25 2002/06/25 02:56:45 brianp Exp $ */
+/* $Id: t_imm_eval.c,v 1.26 2002/10/24 23:57:25 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "colormac.h"
#include "context.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "mmath.h"
#include "mtypes.h"
#include "math/m_eval.h"
-/* $Id: t_imm_exec.c,v 1.42 2002/08/08 16:55:17 brianp Exp $ */
+/* $Id: t_imm_exec.c,v 1.43 2002/10/24 23:57:25 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "enums.h"
#include "dlist.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "mmath.h"
#include "light.h"
#include "state.h"
-/* $Id: t_imm_fixup.c,v 1.37 2002/06/29 19:48:17 brianp Exp $ */
+/* $Id: t_imm_fixup.c,v 1.38 2002/10/24 23:57:25 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "colormac.h"
#include "light.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "mmath.h"
#include "state.h"
#include "mtypes.h"
-/* $Id: t_pipeline.c,v 1.23 2002/10/16 17:57:52 brianp Exp $ */
+/* $Id: t_pipeline.c,v 1.24 2002/10/24 23:57:25 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "glheader.h"
#include "context.h"
-#include "mem.h"
+#include "imports.h"
#include "mmath.h"
#include "state.h"
#include "mtypes.h"
-/* $Id: t_vb_fog.c,v 1.17 2002/01/22 14:35:17 brianp Exp $ */
+/* $Id: t_vb_fog.c,v 1.18 2002/10/24 23:57:25 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "colormac.h"
#include "context.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "mmath.h"
#include "mtypes.h"
-/* $Id: t_vb_light.c,v 1.18 2002/02/13 00:53:20 keithw Exp $ */
+/* $Id: t_vb_light.c,v 1.19 2002/10/24 23:57:25 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "colormac.h"
#include "light.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "mmath.h"
#include "simple_list.h"
#include "mtypes.h"
-/* $Id: t_vb_normals.c,v 1.15 2002/08/08 16:54:43 brianp Exp $ */
+/* $Id: t_vb_normals.c,v 1.16 2002/10/24 23:57:25 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "colormac.h"
#include "context.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "mmath.h"
#include "mtypes.h"
-/* $Id: t_vb_points.c,v 1.8 2002/01/22 14:35:17 brianp Exp $ */
+/* $Id: t_vb_points.c,v 1.9 2002/10/24 23:57:25 brianp Exp $ */
/*
* Mesa 3-D graphics library
*/
#include "mtypes.h"
-#include "mem.h"
+#include "imports.h"
#include "t_context.h"
#include "t_pipeline.h"
-/* $Id: t_vb_program.c,v 1.14 2002/08/08 16:55:56 brianp Exp $ */
+/* $Id: t_vb_program.c,v 1.15 2002/10/24 23:57:25 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "hash.h"
#include "light.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "mmath.h"
#include "simple_list.h"
#include "mtypes.h"
-/* $Id: t_vb_render.c,v 1.31 2002/06/29 19:48:17 brianp Exp $ */
+/* $Id: t_vb_render.c,v 1.32 2002/10/24 23:57:25 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "context.h"
#include "enums.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "mtypes.h"
#include "mmath.h"
-/* $Id: t_vb_texgen.c,v 1.13 2002/06/29 19:48:17 brianp Exp $ */
+/* $Id: t_vb_texgen.c,v 1.14 2002/10/24 23:57:25 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "context.h"
#include "macros.h"
#include "mmath.h"
-#include "mem.h"
+#include "imports.h"
#include "mtypes.h"
#include "math/m_xform.h"
-/* $Id: t_vb_texmat.c,v 1.8 2002/01/22 14:35:17 brianp Exp $ */
+/* $Id: t_vb_texmat.c,v 1.9 2002/10/24 23:57:25 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "colormac.h"
#include "context.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "mmath.h"
#include "mtypes.h"
-/* $Id: t_vb_vertex.c,v 1.14 2002/04/09 16:56:52 keithw Exp $ */
+/* $Id: t_vb_vertex.c,v 1.15 2002/10/24 23:57:25 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "colormac.h"
#include "context.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "mmath.h"
#include "mtypes.h"
#include "api_noop.h"
#include "api_arrayelt.h"
#include "context.h"
-#include "mem.h"
+#include "imports.h"
#include "mmath.h"
#include "mtypes.h"
#include "enums.h"
* Keith Whitwell <keith@tungstengraphics.com>
*/
-#include <stdio.h>
-#include <assert.h>
-#include "mem.h"
+#include "imports.h"
#include "simple_list.h"
#include "t_vtx_api.h"
* Keith Whitwell <keith@tungstengraphics.com>
*/
-#include <stdio.h>
-#include <assert.h>
-#include "mem.h"
+#include "imports.h"
#include "mmath.h"
#include "simple_list.h"
#include "tnl_vtxfmt.h"
-/* $Id: gen_matypes.c,v 1.8 2002/09/19 16:19:45 brianp Exp $ */
+/* $Id: gen_matypes.c,v 1.9 2002/10/24 23:57:23 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2002 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"),
* Mesa, including lighting, clipping, texture image conversion etc.
*/
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
#include "mtypes.h"
#include "tnl/t_context.h"
-#endif
+
#undef offsetof
#define offsetof( type, member ) ((size_t) &((type *)0)->member)