-# $Id: Makefile.X11,v 1.5 1999/09/17 12:07:10 brianp Exp $
+# $Id: Makefile.X11,v 1.6 1999/10/08 09:27:09 keithw Exp $
# Mesa 3-D graphics library
# Version: 3.1
feedback.c \
fog.c \
get.c \
+ glmisc.c \
hash.c \
image.c \
light.c \
logic.c \
masking.c \
matrix.c \
- misc.c \
mmath.c \
mthreads.c \
pb.c \
GrScreenRefresh_t ref,
const GLint attribList[])
{
- fxMesaContext fxMesa = NULL;
- int i,type;
- int aux;
- GLboolean doubleBuffer=GL_FALSE;
- GLboolean alphaBuffer=GL_FALSE;
- GLboolean verbose=GL_FALSE;
- GLint depthSize=0;
- GLint stencilSize=0;
- GLint accumSize=0;
- GLcontext *shareCtx = NULL;
- GLcontext *ctx = 0;
- FX_GrContext_t glideContext = 0;
- char *errorstr;
-
- if (MESA_VERBOSE&VERBOSE_DRIVER) {
- fprintf(stderr,"fxmesa: fxMesaCreateContext() Start\n");
- }
-
- if(getenv("MESA_FX_INFO"))
- verbose=GL_TRUE;
+ fxMesaContext fxMesa = NULL;
+ int i,type;
+ int aux;
+ GLboolean doubleBuffer=GL_FALSE;
+ GLboolean alphaBuffer=GL_FALSE;
+ GLboolean verbose=GL_FALSE;
+ GLint depthSize=0;
+ GLint stencilSize=0;
+ GLint accumSize=0;
+ GLcontext *shareCtx = NULL;
+ GLcontext *ctx = 0;
+ FX_GrContext_t glideContext = 0;
+ char *errorstr;
+
+ if (MESA_VERBOSE&VERBOSE_DRIVER) {
+ fprintf(stderr,"fxmesa: fxMesaCreateContext() Start\n");
+ }
- aux=0;
- i=0;
- while(attribList[i]!=FXMESA_NONE) {
- switch (attribList[i]) {
- case FXMESA_DOUBLEBUFFER:
- doubleBuffer=GL_TRUE;
- break;
- case FXMESA_ALPHA_SIZE:
- i++;
- alphaBuffer=attribList[i]>0;
- if(alphaBuffer)
- aux=1;
- break;
- case FXMESA_DEPTH_SIZE:
- i++;
- depthSize=attribList[i];
- if(depthSize)
- aux=1;
- break;
- case FXMESA_STENCIL_SIZE:
- i++;
- stencilSize=attribList[i];
- break;
- case FXMESA_ACCUM_SIZE:
- i++;
- accumSize=attribList[i];
- break;
- /* XXX ugly hack here for sharing display lists */
+ if(getenv("MESA_FX_INFO"))
+ verbose=GL_TRUE;
+
+ aux=0;
+ i=0;
+ while(attribList[i]!=FXMESA_NONE) {
+ switch (attribList[i]) {
+ case FXMESA_DOUBLEBUFFER:
+ doubleBuffer=GL_TRUE;
+ break;
+ case FXMESA_ALPHA_SIZE:
+ i++;
+ alphaBuffer=attribList[i]>0;
+ if(alphaBuffer)
+ aux=1;
+ break;
+ case FXMESA_DEPTH_SIZE:
+ i++;
+ depthSize=attribList[i];
+ if(depthSize)
+ aux=1;
+ break;
+ case FXMESA_STENCIL_SIZE:
+ i++;
+ stencilSize=attribList[i];
+ break;
+ case FXMESA_ACCUM_SIZE:
+ i++;
+ accumSize=attribList[i];
+ break;
+ /* XXX ugly hack here for sharing display lists */
#define FXMESA_SHARE_CONTEXT 990099 /* keep in sync with xmesa1.c! */
- case FXMESA_SHARE_CONTEXT:
- i++;
- {
- const void *vPtr = &attribList[i];
- GLcontext **ctx = (GLcontext **) vPtr;
- shareCtx = *ctx;
- }
- break;
- default:
- if (MESA_VERBOSE&VERBOSE_DRIVER) {
- fprintf(stderr,"fxmesa: fxMesaCreateContext() End (defualt)\n");
+ case FXMESA_SHARE_CONTEXT:
+ i++;
+ {
+ const void *vPtr = &attribList[i];
+ GLcontext **ctx = (GLcontext **) vPtr;
+ shareCtx = *ctx;
+ }
+ break;
+ default:
+ if (MESA_VERBOSE&VERBOSE_DRIVER) {
+ fprintf(stderr,"fxmesa: fxMesaCreateContext() End (defualt)\n");
+ }
+ return NULL;
}
- return NULL;
- }
- i++;
- }
+ i++;
+ }
- /* A workaround for Linux GLQuake */
- if(depthSize && alphaBuffer)
- alphaBuffer=0;
+ /* A workaround for Linux GLQuake */
+ if(depthSize && alphaBuffer)
+ alphaBuffer=0;
- if(verbose)
- fprintf(stderr,"Mesa fx Voodoo Device Driver v0.30\nWritten by David Bucciarelli (davibu@tin.it.it)\n");
+ if(verbose)
+ fprintf(stderr,"Mesa fx Voodoo Device Driver v0.30\nWritten by David Bucciarelli (davibu@tin.it.it)\n");
- if((type=fxQueryHardware()) >= 0) {
- if(type==GR_SSTTYPE_VOODOO)
- win=0;
+ if((type=fxQueryHardware()) < 0) {
+ fprintf(stderr,"fx Driver: ERROR no Voodoo1/2 Graphics or Voodoo Rush !\n");
+ return NULL;
+ }
- grSstSelect(glbCurrentBoard);
+ if(type==GR_SSTTYPE_VOODOO)
+ win=0;
-#if FXMESA_USE_ARGB
- glideContext = FX_grSstWinOpen((FxU32)win,res,ref,
- GR_COLORFORMAT_ARGB,GR_ORIGIN_LOWER_LEFT,2,aux);
+ grSstSelect(glbCurrentBoard);
-#else
- glideContext = FX_grSstWinOpen((FxU32)win,res,ref,
- GR_COLORFORMAT_ABGR,GR_ORIGIN_LOWER_LEFT,2,aux);
-#endif
- if (!glideContext){
- errorstr = "grSstWinOpen";
+ fxMesa=(fxMesaContext)calloc(1,sizeof(struct tfxMesaContext));
+ if(!fxMesa) {
+ errorstr = "malloc";
goto errorhandler;
- }
+ }
- if(verbose)
+ if(glbHWConfig.SSTs[glbCurrentBoard].type==GR_SSTTYPE_VOODOO)
+ fxMesa->haveTwoTMUs=(glbHWConfig.SSTs[glbCurrentBoard].sstBoard.VoodooConfig.nTexelfx > 1);
+ else if(glbHWConfig.SSTs[glbCurrentBoard].type==GR_SSTTYPE_SST96)
+ fxMesa->haveTwoTMUs=(glbHWConfig.SSTs[glbCurrentBoard].sstBoard.SST96Config.nTexelfx > 1);
+ else
+ fxMesa->haveTwoTMUs=GL_FALSE;
+
+ fxMesa->haveDoubleBuffer=doubleBuffer;
+ fxMesa->haveAlphaBuffer=alphaBuffer;
+ fxMesa->haveGlobalPaletteTexture=GL_FALSE;
+ fxMesa->haveZBuffer=depthSize ? 1 : 0;
+ fxMesa->verbose=verbose;
+ fxMesa->width=FX_grSstScreenWidth();
+ fxMesa->height=FX_grSstScreenHeight();
+ fxMesa->board=glbCurrentBoard;
+
+ if(verbose)
fprintf(stderr,"Glide screen size: %dx%d\n",
(int)FX_grSstScreenWidth(),(int)FX_grSstScreenHeight());
- } else {
- fprintf(stderr,"fx Driver: ERROR no Voodoo1/2 Graphics or Voodoo Rush !\n");
- return NULL;
- }
- fxMesa=(fxMesaContext)calloc(1,sizeof(struct tfxMesaContext));
- if(!fxMesa) {
- errorstr = "malloc";
- goto errorhandler;
- }
-
- FX_setupGrVertexLayout();
-
- fxMesa->glideContext = glideContext;
- fxMesa->board=glbCurrentBoard;
- fxMesa->width=FX_grSstScreenWidth();
- fxMesa->height=FX_grSstScreenHeight();
-
- fxMesa->verbose=verbose;
-
- if(glbHWConfig.SSTs[glbCurrentBoard].type==GR_SSTTYPE_VOODOO)
- fxMesa->haveTwoTMUs=(glbHWConfig.SSTs[glbCurrentBoard].sstBoard.VoodooConfig.nTexelfx > 1);
- else if(glbHWConfig.SSTs[glbCurrentBoard].type==GR_SSTTYPE_SST96)
- fxMesa->haveTwoTMUs=(glbHWConfig.SSTs[glbCurrentBoard].sstBoard.SST96Config.nTexelfx > 1);
- else
- fxMesa->haveTwoTMUs=GL_FALSE;
-
- if (getenv("FX_EMULATE_SINGLE_TMU")) {
- if (MESA_VERBOSE&VERBOSE_DRIVER)
- fprintf(stderr, "\n\nEmulating single tmu\n\n");
- fxMesa->haveTwoTMUs = GL_FALSE;
- }
-
- fxMesa->emulateTwoTMUs = fxMesa->haveTwoTMUs;
-
- if (!getenv("FX_DONT_FAKE_MULTITEX")) {
- if (MESA_VERBOSE&VERBOSE_DRIVER) {
- if (!fxMesa->haveTwoTMUs)
- fprintf(stderr, "\n\nEmulating multitexture\n\n");
- }
- fxMesa->emulateTwoTMUs = GL_TRUE;
- }
-
-
- fxMesa->haveDoubleBuffer=doubleBuffer;
- fxMesa->haveAlphaBuffer=alphaBuffer;
- fxMesa->haveGlobalPaletteTexture=GL_FALSE;
-
- if(getenv("FX_GLIDE_SWAPINTERVAL"))
- fxMesa->swapInterval=atoi(getenv("FX_GLIDE_SWAPINTERVAL"));
- else
- fxMesa->swapInterval=1;
-
- if(getenv("MESA_FX_SWAP_PENDING"))
- fxMesa->maxPendingSwapBuffers=atoi(getenv("MESA_FX_SWAP_PENDING"));
- else
- fxMesa->maxPendingSwapBuffers=2;
-
- fxMesa->color=0xffffffff;
- fxMesa->clearC=0;
- fxMesa->clearA=0;
-
- fxMesa->stats.swapBuffer=0;
- fxMesa->stats.reqTexUpload=0;
- fxMesa->stats.texUpload=0;
- fxMesa->stats.memTexUpload=0;
-
- fxMesa->tmuSrc=FX_TMU_NONE;
- fxMesa->lastUnitsMode=FX_UM_NONE;
- fxTMInit(fxMesa);
-
- /* FX units setup */
-
- fxMesa->unitsState.alphaTestEnabled=GL_FALSE;
- fxMesa->unitsState.alphaTestFunc=GR_CMP_ALWAYS;
- fxMesa->unitsState.alphaTestRefValue=0;
-
- fxMesa->unitsState.blendEnabled=GL_FALSE;
- fxMesa->unitsState.blendSrcFuncRGB=GR_BLEND_ONE;
- fxMesa->unitsState.blendDstFuncRGB=GR_BLEND_ZERO;
- fxMesa->unitsState.blendSrcFuncAlpha=GR_BLEND_ONE;
- fxMesa->unitsState.blendDstFuncAlpha=GR_BLEND_ZERO;
-
- fxMesa->unitsState.depthTestEnabled =GL_FALSE;
- fxMesa->unitsState.depthMask =GL_TRUE;
- fxMesa->unitsState.depthTestFunc =GR_CMP_LESS;
-
- grColorMask(FXTRUE,alphaBuffer ? FXTRUE : FXFALSE);
- if(doubleBuffer) {
- fxMesa->currentFB=GR_BUFFER_BACKBUFFER;
- grRenderBuffer(GR_BUFFER_BACKBUFFER);
- } else {
- fxMesa->currentFB=GR_BUFFER_FRONTBUFFER;
- grRenderBuffer(GR_BUFFER_FRONTBUFFER);
- }
-
- fxMesa->state = NULL;
- fxMesa->fogTable = NULL;
-
- fxMesa->state = malloc(FX_grGetInteger(FX_GLIDE_STATE_SIZE));
- fxMesa->fogTable = malloc(FX_grGetInteger(FX_FOG_TABLE_ENTRIES)*sizeof(GrFog_t));
-
- if (!fxMesa->state || !fxMesa->fogTable) {
- errorstr = "malloc";
- goto errorhandler;
- }
-
- if(depthSize)
- grDepthBufferMode(GR_DEPTHBUFFER_ZBUFFER);
-
-#if (!FXMESA_USE_ARGB)
- grLfbWriteColorFormat(GR_COLORFORMAT_ABGR); /* Not every Glide supports this */
-#endif
-
- fxMesa->glVis=gl_create_visual(GL_TRUE, /* RGB mode */
- alphaBuffer,
- doubleBuffer,
- GL_FALSE, /* stereo */
- depthSize, /* depth_size */
- stencilSize, /* stencil_size */
- accumSize, /* accum_size */
- 0, /* index bits */
- 5,6,5,0); /* RGBA bits */
- if (!fxMesa->glVis) {
- errorstr = "gl_create_visual";
- goto errorhandler;
- }
-
- ctx = fxMesa->glCtx=gl_create_context(fxMesa->glVis,
- shareCtx, /* share list context */
- (void *) fxMesa, GL_TRUE);
- if (!ctx) {
- errorstr = "gl_create_context";
- goto errorhandler;
- }
-
- fxMesa->glBuffer=gl_create_framebuffer(fxMesa->glVis);
- if (!fxMesa->glBuffer) {
- errorstr = "gl_create_framebuffer";
- goto errorhandler;
- }
-
- fxMesa->glCtx->Const.MaxTextureLevels=9;
- fxMesa->glCtx->Const.MaxTextureSize=256;
- fxMesa->glCtx->Const.MaxTextureUnits=fxMesa->emulateTwoTMUs ? 2 : 1;
+ fxMesa->glVis=gl_create_visual(GL_TRUE, /* RGB mode */
+ alphaBuffer,
+ doubleBuffer,
+ GL_FALSE, /* stereo */
+ depthSize, /* depth_size */
+ stencilSize, /* stencil_size */
+ accumSize, /* accum_size */
+ 0, /* index bits */
+ 5,6,5,0); /* RGBA bits */
+ if (!fxMesa->glVis) {
+ errorstr = "gl_create_visual";
+ goto errorhandler;
+ }
- fxMesa->glCtx->NewState|=NEW_DRVSTATE1;
- fxMesa->new_state = NEW_ALL;
-
- fxDDSetupInit();
- fxDDCvaInit();
- fxDDClipInit();
- fxDDTrifuncInit();
- fxDDFastPathInit();
+ ctx = fxMesa->glCtx=gl_create_context(fxMesa->glVis,
+ shareCtx, /* share list context */
+ (void *) fxMesa, GL_TRUE);
+ if (!ctx) {
+ errorstr = "gl_create_context";
+ goto errorhandler;
+ }
- fxSetupDDPointers(fxMesa->glCtx);
- fxDDRenderInit(fxMesa->glCtx);
- fxDDInitExtensions(fxMesa->glCtx);
- fxDDSetNearFar(fxMesa->glCtx,1.0,100.0);
-
- grGlideGetState((GrState*)fxMesa->state);
+ if (!fxDDInitFxMesaContext( fxMesa, win, res, ref, aux )) {
+ errorstr = "fxDDInitFxMesaContext failed";
+ goto errorhandler;
+ }
- /* XXX Fix me: callback not registered when main VB is created.
- */
- if (fxMesa->glCtx->VB)
- fxDDRegisterVB( fxMesa->glCtx->VB );
-
- /* XXX Fix me too: need to have the 'struct dd' prepared prior to
- * creating the context... The below is broken if you try to insert
- * new stages.
- */
- if (ctx->NrPipelineStages)
- ctx->NrPipelineStages = fxDDRegisterPipelineStages( ctx->PipelineStage,
- ctx->PipelineStage,
- ctx->NrPipelineStages);
+ fxMesa->glBuffer=gl_create_framebuffer(fxMesa->glVis);
+ if (!fxMesa->glBuffer) {
+ errorstr = "gl_create_framebuffer";
+ goto errorhandler;
+ }
- glbTotNumCtx++;
-
- /* Run the config file */
- gl_context_initialize( fxMesa->glCtx );
+ glbTotNumCtx++;
- /* install signal handlers */
+ /* install signal handlers */
#if defined(__linux__)
- if (fxMesa->glCtx->CatchSignals) {
- signal(SIGINT,cleangraphics_handler);
- signal(SIGHUP,cleangraphics_handler);
- signal(SIGPIPE,cleangraphics_handler);
- signal(SIGFPE,cleangraphics_handler);
- signal(SIGBUS,cleangraphics_handler);
- signal(SIGILL,cleangraphics_handler);
- signal(SIGSEGV,cleangraphics_handler);
- signal(SIGTERM,cleangraphics_handler);
- }
+ if (fxMesa->glCtx->CatchSignals) {
+ signal(SIGINT,cleangraphics_handler);
+ signal(SIGHUP,cleangraphics_handler);
+ signal(SIGPIPE,cleangraphics_handler);
+ signal(SIGFPE,cleangraphics_handler);
+ signal(SIGBUS,cleangraphics_handler);
+ signal(SIGILL,cleangraphics_handler);
+ signal(SIGSEGV,cleangraphics_handler);
+ signal(SIGTERM,cleangraphics_handler);
+ }
#endif
- if (MESA_VERBOSE&VERBOSE_DRIVER) {
- fprintf(stderr,"fxmesa: fxMesaCreateContext() End\n");
- }
+ if (MESA_VERBOSE&VERBOSE_DRIVER) {
+ fprintf(stderr,"fxmesa: fxMesaCreateContext() End\n");
+ }
- return fxMesa;
+ return fxMesa;
-errorhandler:
+ errorhandler:
if (fxMesa) {
if (fxMesa->glideContext)
- FX_grSstWinClose(fxMesa->glideContext);
+ FX_grSstWinClose(fxMesa->glideContext);
fxMesa->glideContext = 0;
if (fxMesa->state)
- free(fxMesa->state);
+ free(fxMesa->state);
if (fxMesa->fogTable)
- free(fxMesa->fogTable);
+ free(fxMesa->fogTable);
if (fxMesa->glBuffer)
- gl_destroy_framebuffer(fxMesa->glBuffer);
+ gl_destroy_framebuffer(fxMesa->glBuffer);
if (fxMesa->glVis)
- gl_destroy_visual(fxMesa->glVis);
+ gl_destroy_visual(fxMesa->glVis);
if (fxMesa->glCtx)
- gl_destroy_context(fxMesa->glCtx);
+ gl_destroy_context(fxMesa->glCtx);
free(fxMesa);
}
- if (MESA_VERBOSE&VERBOSE_DRIVER) {
+ if (MESA_VERBOSE&VERBOSE_DRIVER) {
fprintf(stderr,"fxmesa: fxMesaCreateContext() End (%s)\n",errorstr);
- }
- return NULL;
+ }
+ return NULL;
}
#if defined(FX)
+#include "types.h"
#include "fxdrv.h"
#include "enums.h"
#include "extensions.h"
*/
static const GLubyte *fxDDGetString(GLcontext *ctx, GLenum name)
{
- static char *extensions="GL_EXT_blend_color GL_EXT_blend_minmax GL_EXT_blend_logic_op GL_EXT_blend_subtract GL_EXT_paletted_texture GL_EXT_point_parameters GL_EXT_polygon_offset GL_EXT_vertex_array GL_EXT_texture_object GL_EXT_texture3D GL_MESA_window_pos GL_MESA_resize_buffers GL_EXT_shared_texture_palette GL_EXT_rescale_normal GL_EXT_abgr GL_SGIS_texture_edge_clamp 3DFX_set_global_palette GL_FXMESA_global_texture_lod_bias";
+ switch (name) {
+ case GL_RENDERER:
+#if defined(GLX_DIRECT_RENDERING)
+ return "Mesa Glide - DRI VB/V3";
+#else
+ return "Mesa Glide";
+#endif
+ default:
+ return NULL;
+ }
+}
- static char buf[MAX_NUM_SST][64];
- fxQueryHardware();
+int fxDDInitFxMesaContext( fxMesaContext fxMesa,
+ int win,
+ int res,
+ int ref,
+ int aux )
+{
+ FX_GrContext_t glideContext = FX_grSstWinOpen((FxU32)win,res,ref,
+#if FXMESA_USE_ARGB
+ GR_COLORFORMAT_ARGB,
+#else
+ GR_COLORFORMAT_ABGR,
+#endif
+ GR_ORIGIN_LOWER_LEFT,
+ 2,
+ aux);
+
+ if (!glideContext) return 0;
+
+ FX_setupGrVertexLayout();
+
+ fxMesa->glideContext = glideContext;
+
+ if (getenv("FX_EMULATE_SINGLE_TMU"))
+ fxMesa->haveTwoTMUs = GL_FALSE;
+
+ fxMesa->emulateTwoTMUs = fxMesa->haveTwoTMUs;
+
+ if (!getenv("FX_DONT_FAKE_MULTITEX"))
+ fxMesa->emulateTwoTMUs = GL_TRUE;
+
+ if(getenv("FX_GLIDE_SWAPINTERVAL"))
+ fxMesa->swapInterval=atoi(getenv("FX_GLIDE_SWAPINTERVAL"));
+ else
+ fxMesa->swapInterval=1;
+
+ if(getenv("MESA_FX_SWAP_PENDING"))
+ fxMesa->maxPendingSwapBuffers=atoi(getenv("MESA_FX_SWAP_PENDING"));
+ else
+ fxMesa->maxPendingSwapBuffers=2;
+
+ fxMesa->color=0xffffffff;
+ fxMesa->clearC=0;
+ fxMesa->clearA=0;
+
+ fxMesa->stats.swapBuffer=0;
+ fxMesa->stats.reqTexUpload=0;
+ fxMesa->stats.texUpload=0;
+ fxMesa->stats.memTexUpload=0;
+
+ fxMesa->tmuSrc=FX_TMU_NONE;
+ fxMesa->lastUnitsMode=FX_UM_NONE;
+ fxTMInit(fxMesa);
+
+ /* FX units setup */
+
+ fxMesa->unitsState.alphaTestEnabled=GL_FALSE;
+ fxMesa->unitsState.alphaTestFunc=GR_CMP_ALWAYS;
+ fxMesa->unitsState.alphaTestRefValue=0;
+
+ fxMesa->unitsState.blendEnabled=GL_FALSE;
+ fxMesa->unitsState.blendSrcFuncRGB=GR_BLEND_ONE;
+ fxMesa->unitsState.blendDstFuncRGB=GR_BLEND_ZERO;
+ fxMesa->unitsState.blendSrcFuncAlpha=GR_BLEND_ONE;
+ fxMesa->unitsState.blendDstFuncAlpha=GR_BLEND_ZERO;
+
+ fxMesa->unitsState.depthTestEnabled =GL_FALSE;
+ fxMesa->unitsState.depthMask =GL_TRUE;
+ fxMesa->unitsState.depthTestFunc =GR_CMP_LESS;
+
+ grColorMask(FXTRUE, fxMesa->haveAlphaBuffer ? FXTRUE : FXFALSE);
+ if(fxMesa->haveDoubleBuffer) {
+ fxMesa->currentFB=GR_BUFFER_BACKBUFFER;
+ grRenderBuffer(GR_BUFFER_BACKBUFFER);
+ } else {
+ fxMesa->currentFB=GR_BUFFER_FRONTBUFFER;
+ grRenderBuffer(GR_BUFFER_FRONTBUFFER);
+ }
+
+ fxMesa->state = NULL;
+ fxMesa->fogTable = NULL;
+
+ fxMesa->state = malloc(FX_grGetInteger(FX_GLIDE_STATE_SIZE));
+ fxMesa->fogTable = malloc(FX_grGetInteger(FX_FOG_TABLE_ENTRIES)*sizeof(GrFog_t));
+
+ if (!fxMesa->state || !fxMesa->fogTable) {
+ if (fxMesa->state) free(fxMesa->state);
+ if (fxMesa->fogTable) free(fxMesa->fogTable);
+ return 0;
+ }
- switch (name) {
- case GL_RENDERER:
- if(glbHWConfig.SSTs[glbCurrentBoard].type==GR_SSTTYPE_VOODOO) {
- sprintf(buf[glbCurrentBoard],"Mesa Glide v0.30 Voodoo_Graphics %d CARD/%d FB/%d TM/%d TMU/%s",
- glbCurrentBoard,
+ if(fxMesa->haveZBuffer)
+ grDepthBufferMode(GR_DEPTHBUFFER_ZBUFFER);
+
+#if (!FXMESA_USE_ARGB)
+ grLfbWriteColorFormat(GR_COLORFORMAT_ABGR); /* Not every Glide has this */
+#endif
- (glbHWConfig.SSTs[glbCurrentBoard].sstBoard.VoodooConfig.sliDetect ?
- (glbHWConfig.SSTs[glbCurrentBoard].sstBoard.VoodooConfig.fbRam*2) :
- glbHWConfig.SSTs[glbCurrentBoard].sstBoard.VoodooConfig.fbRam),
+ fxMesa->glCtx->Const.MaxTextureLevels=9;
+ fxMesa->glCtx->Const.MaxTextureSize=256;
+ fxMesa->glCtx->Const.MaxTextureUnits=fxMesa->emulateTwoTMUs ? 2 : 1;
+ fxMesa->glCtx->NewState|=NEW_DRVSTATE1;
+ fxMesa->new_state = NEW_ALL;
+
+ fxDDSetupInit();
+ fxDDCvaInit();
+ fxDDClipInit();
+ fxDDTrifuncInit();
+ fxDDFastPathInit();
- glbHWConfig.SSTs[glbCurrentBoard].sstBoard.VoodooConfig.tmuConfig[GR_TMU0].tmuRam+
- ((glbHWConfig.SSTs[glbCurrentBoard].sstBoard.VoodooConfig.nTexelfx>1) ?
- glbHWConfig.SSTs[glbCurrentBoard].sstBoard.VoodooConfig.tmuConfig[GR_TMU1].tmuRam :
- 0),
+ fxSetupDDPointers(fxMesa->glCtx);
+ fxDDRenderInit(fxMesa->glCtx);
+ fxDDInitExtensions(fxMesa->glCtx);
- glbHWConfig.SSTs[glbCurrentBoard].sstBoard.VoodooConfig.nTexelfx,
+ fxDDSetNearFar(fxMesa->glCtx,1.0,100.0);
+
+ grGlideGetState((GrState*)fxMesa->state);
- (glbHWConfig.SSTs[glbCurrentBoard].sstBoard.VoodooConfig.sliDetect ? "SLI" : "NOSLI")
- );
- }
- else {
- if(glbHWConfig.SSTs[glbCurrentBoard].type==GR_SSTTYPE_SST96)
- sprintf(buf[glbCurrentBoard],"Glide v0.30 Voodoo_Rush %d CARD/%d FB/%d TM/%d TMU/NOSLI",
- glbCurrentBoard,
+ /* XXX Fix me: callback not registered when main VB is created.
+ */
+ if (fxMesa->glCtx->VB)
+ fxDDRegisterVB( fxMesa->glCtx->VB );
+
+ /* XXX Fix me too: need to have the 'struct dd' prepared prior to
+ * creating the context... The below is broken if you try to insert
+ * new stages.
+ */
+ if (fxMesa->glCtx->NrPipelineStages)
+ fxMesa->glCtx->NrPipelineStages = fxDDRegisterPipelineStages(
+ fxMesa->glCtx->PipelineStage,
+ fxMesa->glCtx->PipelineStage,
+ fxMesa->glCtx->NrPipelineStages);
+
+ /* Run the config file */
+ gl_context_initialize( fxMesa->glCtx );
+
+ return 1;
+}
- glbHWConfig.SSTs[glbCurrentBoard].sstBoard.SST96Config.fbRam,
- glbHWConfig.SSTs[glbCurrentBoard].sstBoard.SST96Config.tmuConfig.tmuRam,
- glbHWConfig.SSTs[glbCurrentBoard].sstBoard.SST96Config.nTexelfx
- );
- else
- strcpy(buf[glbCurrentBoard],"Glide v0.30 UNKNOWN");
- }
- return (GLubyte *) buf[glbCurrentBoard];
- case GL_EXTENSIONS:
- return (GLubyte *) extensions;
- default:
- return NULL;
- }
-}
void fxDDInitExtensions( GLcontext *ctx )
* you turn debugging on/off from the debugger.
*/
+#ifndef XFree86Server
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#include <assert.h>
+#else
+#include "GL/xf86glx.h"
+#endif
+
#if defined(__linux__)
#include <signal.h>
};
#define FX_DRIVER_DATA(vb) ((struct tfxMesaVertexBuffer *)((vb)->driver_data))
-#define FX_CONTEXT(ctx) ((struct tfxMesaContext *)((ctx)->DriverCtx))
+#define FX_CONTEXT(ctx) ((fxMesaContext)((ctx)->DriverCtx))
#define FX_TEXTURE_DATA(t) ((tfxTexInfo *) ((t)->Current->DriverData))
+#if defined(XFree86Server) || defined(GLX_DIRECT_RENDERING)
+#include "tdfx_init.h"
+#else
+#define DRI_FX_CONTEXT
+#endif
+
struct tfxMesaContext {
GuTexPalette glbPalette;
GLboolean haveTwoTMUs; /* True if we really have 2 tmu's */
GLboolean emulateTwoTMUs; /* True if we present 2 tmu's to mesa. */
GLboolean haveAlphaBuffer;
+ GLboolean haveZBuffer;
GLboolean haveDoubleBuffer;
GLboolean haveGlobalPaletteTexture;
GLint swapInterval;
GLint maxPendingSwapBuffers;
FX_GrContext_t glideContext;
+
+ DRI_FX_CONTEXT
+
};
typedef void (*tfxSetupFunc)(struct vertex_buffer *, GLuint, GLuint);
extern void fxSetupDDPointers(GLcontext *);
extern void fxDDSetNearFar(GLcontext *, GLfloat, GLfloat);
-extern void fxDDSetupInit();
-extern void fxDDCvaInit();
-extern void fxDDTrifuncInit();
-extern void fxDDFastPathInit();
+extern void fxDDSetupInit(void);
+extern void fxDDCvaInit(void);
+extern void fxDDTrifuncInit(void);
+extern void fxDDFastPathInit(void);
extern void fxDDChooseRenderState( GLcontext *ctx );
extern render_func **fxDDChooseRenderVBTables(GLcontext *);
extern void fxDDRenderInit(GLcontext *);
-extern void fxDDClipInit();
+extern void fxDDClipInit(void);
extern void fxUpdateDDSpanPointers(GLcontext *);
extern void fxSetupDDSpanPointers(GLcontext *);
extern void fxDDInitExtensions( GLcontext *ctx );
-extern void fxTMInit(fxMesaContext);
-extern void fxTMClose(fxMesaContext);
+extern void fxTMInit(fxMesaContext ctx);
+extern void fxTMClose(fxMesaContext ctx);
extern void fxTMMoveInTM(fxMesaContext, struct gl_texture_object *, GLint);
extern void fxTMMoveOutTM(fxMesaContext, struct gl_texture_object *);
extern void fxTMFreeTexture(fxMesaContext, struct gl_texture_object *);
extern void fxDDDoRenderVB( struct vertex_buffer *VB );
+extern int fxDDInitFxMesaContext( fxMesaContext fxMesa,
+ int win, int res, int ref, int aux );
#endif
-/* $Id: xmesaP.h,v 1.1 1999/08/19 00:55:42 jtg Exp $ */
+/* $Id: xmesaP.h,v 1.2 1999/10/08 09:27:12 keithw Exp $ */
/*
* Mesa 3-D graphics library
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
+/* $XFree86: xc/lib/GL/mesa/src/X/xmesaP.h,v 1.5 1999/07/06 14:51:28 dawes Exp $ */
+
+
#ifndef XMESAP_H
#ifdef XFree86Server
-#include "xf86glx_util.h"
+# include "GL/xf86glx.h"
+# include "xf86glx_util.h"
#else
-#ifdef SHM
-#include <X11/extensions/XShm.h>
-#endif
+# ifdef GLX_DIRECT_RENDERING
+# include "dri_mesa.h"
+# endif
+# ifdef SHM
+# include <X11/extensions/XShm.h>
+# endif
#endif
#include "GL/xmesa.h"
#include "types.h"
-#ifdef FX
+#if defined(FX) && !defined(GLX_DIRECT_RENDERING)
#include "GL/fxmesa.h"
#include "../FX/fxdrv.h"
#endif
+#if defined(GLX_DIRECT_RENDERING) && !defined(XFree86Server)
+# include "xdriP.h"
+#else
+# define DRI_DRAWABLE_ARG
+# define DRI_DRAWABLE_PARM
+# define DRI_CTX_ARG
+#endif
+
+
/* for PF_8R8G8B24 pixel format */
typedef struct {
GLubyte b;
} bgr_t;
+
+
/*
* "Derived" from gl_visual. Basically corresponds to an XVisualInfo.
*/
struct xmesa_visual {
GLvisual *gl_visual; /* Device independent visual parameters */
XMesaDisplay *display; /* The X11 display */
-#ifndef XFree86Server
+#ifdef XFree86Server
+ GLint screen_depth; /* The depth of the screen */
+#else
XVisualInfo *vishandle; /* The pointer returned by glXChooseVisual */
#endif
XMesaVisualInfo visinfo; /* X's visual info */
GLubyte clearcolor[4]; /* current clearing color */
unsigned long clearpixel; /* current clearing pixel value */
+
+#if defined(GLX_DIRECT_RENDERING) && !defined(XFree86Server)
+ __DRIcontextPrivate *driContextPriv; /* back pointer to DRI context
+ * used for locking
+ */
+ void *private; /* device-specific private context */
+#endif
};
int num_alloced;
unsigned long alloced_colors[256];
-#ifdef FX
+#if defined(GLX_DIRECT_RENDERING) && !defined(XFree86Server)
+ __DRIdrawablePrivate *driDrawPriv; /* back pointer to DRI drawable
+ * used for direct access to framebuffer
+ */
+ void *private; /* device-specific private drawable */
+#endif
+
+#if defined( FX ) && !defined(GLX_DIRECT_RENDERING)
/* For 3Dfx Glide only */
GLboolean FXisHackUsable; /* Can we render into window? */
GLboolean FXwindowHack; /* Are we rendering into a window? */
+
/*
* If pixelformat==PF_DITHER:
*
#undef _R
#undef _G
#undef _B
+#undef _D
#ifdef DITHER666
# define _R 6
# define _G 6
/* XXX this is a hack to implement shared display lists with 3Dfx */
extern XMesaBuffer XMesaCreateWindowBuffer2( XMesaVisual v,
XMesaWindow w,
- XMesaContext c );
-
+ XMesaContext c
+ DRI_DRAWABLE_ARG
+ );
/*
* These are the extra routines required for integration with XFree86.
-# $Id: Makefile.DJ,v 1.1 1999/08/19 00:55:41 jtg Exp $
+# $Id: Makefile.DJ,v 1.2 1999/10/08 09:27:09 keithw Exp $
# Makefile for core library for MS-DOS using djgpp
# $Log: Makefile.DJ,v $
-# Revision 1.1 1999/08/19 00:55:41 jtg
-# Initial revision
+# Revision 1.2 1999/10/08 09:27:09 keithw
+# Fixed includes & added a few hooks for the DRI.
+#
+# Revision 1.1.1.1 1999/08/19 00:55:41 jtg
+# Imported sources
#
# Revision 1.1 1999/01/01 14:35:09 brianp
# Initial revision
bitmap.c blend.c clip.c colortab.c context.c copypix.c depth.c \
dlist.c drawpix.c enable.c eval.c feedback.c fog.c \
get.c hash.c image.c light.c lines.c logic.c masking.c matrix.c \
- misc.c mmath.c mthreads.c pb.c pixel.c points.c pointers.c polygon.c \
+ glmisc.c mmath.c mthreads.c pb.c pixel.c points.c pointers.c polygon.c \
quads.c rastpos.c readpix.c rect.c scissor.c shade.c span.c \
stencil.c teximage.c texobj.c texstate.c texture.c triangle.c \
varray.c winpos.c vb.c vbfill.c vbrender.c vbxform.c xform.c \
-# $Id: Makefile.X11,v 1.5 1999/09/17 12:07:10 brianp Exp $
+# $Id: Makefile.X11,v 1.6 1999/10/08 09:27:09 keithw Exp $
# Mesa 3-D graphics library
# Version: 3.1
feedback.c \
fog.c \
get.c \
+ glmisc.c \
hash.c \
image.c \
light.c \
logic.c \
masking.c \
matrix.c \
- misc.c \
mmath.c \
mthreads.c \
pb.c \
-/* $Id: accum.c,v 1.2 1999/08/19 11:54:28 brianp Exp $ */
+/* $Id: accum.c,v 1.3 1999/10/08 09:27:09 keithw Exp $ */
/*
* Mesa 3-D graphics library
*/
+/* $XFree86: xc/lib/GL/mesa/src/accum.c,v 1.3 1999/04/04 00:20:17 dawes Exp $ */
#ifdef PC_HEADER
#include "all.h"
#else
-#include <assert.h>
+#ifndef XFree86Server
#include <limits.h>
#include <stdlib.h>
#include <string.h>
+#else
+#include "GL/xf86glx.h"
+#endif
#include "accum.h"
#include "context.h"
#include "macros.h"
-/* $Id: attrib.c,v 1.4 1999/09/19 23:43:02 keithw Exp $ */
+/* $Id: attrib.c,v 1.5 1999/10/08 09:27:10 keithw Exp $ */
/*
* Mesa 3-D graphics library
#ifdef PC_HEADER
#include "all.h"
#else
+#ifndef XFree86Server
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+#else
+#include "GL/xf86glx.h"
+#endif
#include "attrib.h"
#include "context.h"
+#include "glmisc.h"
#include "enable.h"
#include "enums.h"
#include "macros.h"
-#include "misc.h"
#include "simple_list.h"
#include "texstate.h"
#include "types.h"
-/* $Id: blend.c,v 1.3 1999/09/30 11:18:21 keithw Exp $ */
+/* $Id: blend.c,v 1.4 1999/10/08 09:27:10 keithw Exp $ */
/*
* Mesa 3-D graphics library
#ifdef PC_HEADER
#include "all.h"
#else
+#include <stdio.h>
+#ifndef XFree86Server
#include <assert.h>
#include <stdlib.h>
-#include <stdio.h>
+#else
+#include "GL/xf86glx.h"
+#endif
#include "alphabuf.h"
#include "blend.h"
#include "context.h"
-/* $Id: clip.c,v 1.2 1999/09/18 20:41:22 keithw Exp $ */
+/* $Id: clip.c,v 1.3 1999/10/08 09:27:10 keithw Exp $ */
/*
* Mesa 3-D graphics library
#ifdef PC_HEADER
#include "all.h"
#else
+#ifndef XFree86Server
#include <string.h>
#include <stdlib.h>
-#include <stdio.h>
+#else
+#include "GL/xf86glx.h"
+#endif
#include "clip.h"
#include "context.h"
#include "macros.h"
-/* $Id: colortab.c,v 1.1 1999/08/19 00:55:41 jtg Exp $ */
+/* $Id: colortab.c,v 1.2 1999/10/08 09:27:10 keithw Exp $ */
/*
* Mesa 3-D graphics library
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
+/* $XFree86: xc/lib/GL/mesa/src/colortab.c,v 1.2 1999/04/04 00:20:21 dawes Exp $ */
#ifdef PC_HEADER
#include "all.h"
#else
+#ifdef XFree86Server
+#include "GL/xf86glx.h"
+#endif
#include "colortab.h"
#include "context.h"
#include "macros.h"
-/* $Id: context.c,v 1.9 1999/09/19 23:43:02 keithw Exp $ */
+/* $Id: context.c,v 1.10 1999/10/08 09:27:10 keithw Exp $ */
/*
* Mesa 3-D graphics library
*/
+/* $XFree86: xc/lib/GL/mesa/src/context.c,v 1.4 1999/04/04 00:20:21 dawes Exp $ */
+
/*
* If multi-threading is enabled (-DTHREADS) then each thread has it's
* own rendering context. A thread obtains the pointer to its GLcontext
#ifdef PC_HEADER
#include "all.h"
#else
+#ifndef XFree86Server
#include <assert.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#else
+#include "GL/xf86glx.h"
+#endif
#include "accum.h"
#include "alphabuf.h"
#include "api.h"
-/* $Id: depth.c,v 1.3 1999/09/19 23:43:02 keithw Exp $ */
+/* $Id: depth.c,v 1.4 1999/10/08 09:27:10 keithw Exp $ */
/*
* Mesa 3-D graphics library
*/
+/* $XFree86: xc/lib/GL/mesa/src/depth.c,v 1.3 1999/04/04 00:20:22 dawes Exp $ */
+
/*
* Depth buffer functions
*/
#ifdef PC_HEADER
#include "all.h"
#else
+#ifndef XFree86Server
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+#else
+#include "GL/xf86glx.h"
+#endif
#include "context.h"
#include "enums.h"
#include "depth.h"
-/* $Id: depth.h,v 1.1 1999/08/19 00:55:41 jtg Exp $ */
+
+/* $Id: depth.h,v 1.2 1999/10/08 09:27:10 keithw Exp $ */
/*
* Mesa 3-D graphics library
-/* $Id: dlist.c,v 1.5 1999/09/20 14:30:22 keithw Exp $ */
+/* $Id: dlist.c,v 1.6 1999/10/08 09:27:10 keithw Exp $ */
/*
* Mesa 3-D graphics library
*/
+/* $XFree86: xc/lib/GL/mesa/src/dlist.c,v 1.3 1999/04/04 00:20:22 dawes Exp $ */
+
#ifdef PC_HEADER
#include "all.h"
#else
+#ifndef XFree86Server
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#else
+#include "GL/xf86glx.h"
+#endif
#include "accum.h"
#include "api.h"
#include "alpha.h"
#include "feedback.h"
#include "fog.h"
#include "get.h"
+#include "glmisc.h"
#include "hash.h"
#include "image.h"
#include "light.h"
#include "macros.h"
#include "masking.h"
#include "matrix.h"
-#include "misc.h"
#include "pipeline.h"
#include "pixel.h"
#include "points.h"
-/* $Id: drawpix.c,v 1.2 1999/09/18 20:41:22 keithw Exp $ */
+/* $Id: drawpix.c,v 1.3 1999/10/08 09:27:10 keithw Exp $ */
/*
* Mesa 3-D graphics library
#ifdef PC_HEADER
#include "all.h"
#else
+#ifndef XFree86Server
#include <assert.h>
#include <stdlib.h>
#include <string.h>
+#else
+#include "GL/xf86glx.h"
+#endif
#include "context.h"
#include "drawpix.h"
#include "feedback.h"
-/* $Id: enable.c,v 1.5 1999/09/18 20:41:23 keithw Exp $ */
+/* $Id: enable.c,v 1.6 1999/10/08 09:27:10 keithw Exp $ */
/*
* Mesa 3-D graphics library
*/
+/* $XFree86: xc/lib/GL/mesa/src/enable.c,v 1.3 1999/04/04 00:20:23 dawes Exp $ */
+
#ifdef PC_HEADER
#include "all.h"
#else
-#include <string.h>
+#ifndef XFree86Server
#include <stdio.h>
+#include <string.h>
+#else
+#include "GL/xf86glx.h"
+#endif
#include "context.h"
#include "enable.h"
#include "light.h"
-/* $Id: eval.c,v 1.1 1999/08/19 00:55:41 jtg Exp $ */
+/* $Id: eval.c,v 1.2 1999/10/08 09:27:10 keithw Exp $ */
/*
* Mesa 3-D graphics library
#ifdef PC_HEADER
#include "all.h"
#else
+#ifndef XFree86Server
#include <math.h>
#include <stdlib.h>
#include <string.h>
+#else
+#include "GL/xf86glx.h"
+#endif
#include "context.h"
#include "eval.h"
#include "macros.h"
-void eval_points1( GLfloat outcoord[][4],
+static void eval_points1( GLfloat outcoord[][4],
GLfloat coord[][4],
const GLuint *flags,
GLfloat du, GLfloat u1 )
}
}
-void eval_points2( GLfloat outcoord[][4],
+static void eval_points2( GLfloat outcoord[][4],
GLfloat coord[][4],
const GLuint *flags,
GLfloat du, GLfloat u1,
};
-GLvector4f *eval1_4f( GLvector4f *dest,
- GLfloat coord[][4],
- const GLuint *flags,
- GLuint dimension,
- struct gl_1d_map *map )
+static GLvector4f *eval1_4f( GLvector4f *dest,
+ GLfloat coord[][4],
+ const GLuint *flags,
+ GLuint dimension,
+ struct gl_1d_map *map )
{
const GLfloat u1 = map->u1;
const GLfloat du = map->du;
}
-GLvector1ui *eval1_1ui( GLvector1ui *dest,
- GLfloat coord[][4],
- const GLuint *flags,
- struct gl_1d_map *map )
+static GLvector1ui *eval1_1ui( GLvector1ui *dest,
+ GLfloat coord[][4],
+ const GLuint *flags,
+ struct gl_1d_map *map )
{
const GLfloat u1 = map->u1;
const GLfloat du = map->du;
return dest;
}
-GLvector3f *eval1_norm( GLvector3f *dest,
+static GLvector3f *eval1_norm( GLvector3f *dest,
GLfloat coord[][4],
GLuint *flags, /* not const */
struct gl_1d_map *map )
return dest;
}
-GLvector4ub *eval1_color( GLvector4ub *dest,
+static GLvector4ub *eval1_color( GLvector4ub *dest,
GLfloat coord[][4],
GLuint *flags, /* not const */
struct gl_1d_map *map )
-GLvector4f *eval2_obj_norm( GLvector4f *obj_ptr,
- GLvector3f *norm_ptr,
- GLfloat coord[][4],
- GLuint *flags,
- GLuint dimension,
- struct gl_2d_map *map )
+static GLvector4f *eval2_obj_norm( GLvector4f *obj_ptr,
+ GLvector3f *norm_ptr,
+ GLfloat coord[][4],
+ GLuint *flags,
+ GLuint dimension,
+ struct gl_2d_map *map )
{
const GLfloat u1 = map->u1;
const GLfloat du = map->du;
}
-GLvector4f *eval2_4f( GLvector4f *dest,
- GLfloat coord[][4],
- const GLuint *flags,
- GLuint dimension,
- struct gl_2d_map *map )
+static GLvector4f *eval2_4f( GLvector4f *dest,
+ GLfloat coord[][4],
+ const GLuint *flags,
+ GLuint dimension,
+ struct gl_2d_map *map )
{
const GLfloat u1 = map->u1;
const GLfloat du = map->du;
}
-GLvector3f *eval2_norm( GLvector3f *dest,
- GLfloat coord[][4],
- GLuint *flags,
- struct gl_2d_map *map )
+static GLvector3f *eval2_norm( GLvector3f *dest,
+ GLfloat coord[][4],
+ GLuint *flags,
+ struct gl_2d_map *map )
{
const GLfloat u1 = map->u1;
const GLfloat du = map->du;
}
-GLvector1ui *eval2_1ui( GLvector1ui *dest,
- GLfloat coord[][4],
- const GLuint *flags,
- struct gl_2d_map *map )
+static GLvector1ui *eval2_1ui( GLvector1ui *dest,
+ GLfloat coord[][4],
+ const GLuint *flags,
+ struct gl_2d_map *map )
{
const GLfloat u1 = map->u1;
const GLfloat du = map->du;
-GLvector4ub *eval2_color( GLvector4ub *dest,
- GLfloat coord[][4],
- GLuint *flags,
- struct gl_2d_map *map )
+static GLvector4ub *eval2_color( GLvector4ub *dest,
+ GLfloat coord[][4],
+ GLuint *flags,
+ struct gl_2d_map *map )
{
const GLfloat u1 = map->u1;
const GLfloat du = map->du;
}
-GLvector4f *copy_4f( GLvector4f *out, CONST GLvector4f *in,
- const GLuint *flags)
+static GLvector4f *copy_4f( GLvector4f *out, CONST GLvector4f *in,
+ const GLuint *flags)
{
GLfloat (*to)[4] = out->data;
GLfloat (*from)[4] = in->data;
return out;
}
-GLvector3f *copy_3f( GLvector3f *out, CONST GLvector3f *in,
- const GLuint *flags)
+static GLvector3f *copy_3f( GLvector3f *out, CONST GLvector3f *in,
+ const GLuint *flags)
{
GLfloat (*to)[3] = out->data;
GLfloat (*from)[3] = in->data;
return out;
}
-GLvector4ub *copy_4ub( GLvector4ub *out, CONST GLvector4ub *in,
- const GLuint *flags )
+static GLvector4ub *copy_4ub( GLvector4ub *out, CONST GLvector4ub *in,
+ const GLuint *flags )
{
GLubyte (*to)[4] = out->data;
GLubyte (*from)[4] = in->data;
return out;
}
-GLvector1ui *copy_1ui( GLvector1ui *out, CONST GLvector1ui *in,
- const GLuint *flags )
+static GLvector1ui *copy_1ui( GLvector1ui *out, CONST GLvector1ui *in,
+ const GLuint *flags )
{
GLuint *to = out->data;
CONST GLuint *from = in->data;
-/* $Id: extensions.c,v 1.4 1999/09/16 16:47:35 brianp Exp $ */
+/* $Id: extensions.c,v 1.5 1999/10/08 09:27:10 keithw Exp $ */
/*
* Mesa 3-D graphics library
static struct { int enabled; const char *name; } default_extensions[] = {
{ ALWAYS_ENABLED, "GL_EXT_blend_color" },
- { ALWAYS_ENABLED, "GL_EXT_blend_minmax" },
- { ALWAYS_ENABLED, "GL_EXT_blend_logic_op" },
- { ALWAYS_ENABLED, "GL_EXT_blend_subtract" },
- { ALWAYS_ENABLED, "GL_EXT_paletted_texture" },
+ { DEFAULT_OFF, "ARB_imaging" },
+ { DEFAULT_ON, "GL_EXT_blend_minmax" },
+ { DEFAULT_ON, "GL_EXT_blend_logic_op" },
+ { DEFAULT_ON, "GL_EXT_blend_subtract" },
+ { DEFAULT_ON, "GL_EXT_paletted_texture" },
{ DEFAULT_ON, "GL_EXT_point_parameters" },
{ ALWAYS_ENABLED, "GL_EXT_polygon_offset" },
{ ALWAYS_ENABLED, "GL_EXT_vertex_array" },
{ ALWAYS_ENABLED, "GL_EXT_abgr" },
{ ALWAYS_ENABLED, "GL_SGIS_texture_edge_clamp" },
{ ALWAYS_ENABLED, "GL_EXT_stencil_wrap" },
- { ALWAYS_ENABLED, "GL_INGR_blend_func_separate" },
+ { DEFAULT_ON, "GL_INGR_blend_func_separate" },
{ DEFAULT_ON, "GL_ARB_multitexture" },
{ ALWAYS_ENABLED, "GL_NV_texgen_reflection" },
{ DEFAULT_ON, "GL_PGI_misc_hints" },
if (ctx->Extensions.ext_list) {
foreach_s( i, nexti, ctx->Extensions.ext_list ) {
+ remove_from_list( i );
free( i );
}
* Also, this function does not yet do per-context function searches.
* Not applicable to Mesa at this time.
*/
-GLfunction gl_GetProcAddress( GLcontext *ctx, const GLubyte *procName )
+void (* gl_GetProcAddress( GLcontext *ctx, const GLubyte *procName ))()
{
struct proc {
const char *name;
-/* $Id: extensions.h,v 1.3 1999/09/11 11:48:11 brianp Exp $ */
+/* $Id: extensions.h,v 1.4 1999/10/08 09:27:10 keithw Exp $ */
/*
* Mesa 3-D graphics library
/* Return 0 on success.
*/
extern int gl_extensions_add( struct gl_context *ctx, int state,
- const char *name, void (*notify)() );
+ const char *name, void (*notify)( void ) );
extern int gl_extensions_enable( struct gl_context *ctx, const char *name );
extern int gl_extensions_disable( struct gl_context *ctx, const char *name );
extern void gl_extensions_ctr( struct gl_context *ctx );
extern const char *gl_extensions_get_string( struct gl_context *ctx );
-extern GLfunction gl_GetProcAddress( GLcontext *ctx, const GLubyte *procName );
+extern void (*gl_GetProcAddress( GLcontext *ctx, const GLubyte *procName ))( void );
#endif
-/* $Id: feedback.c,v 1.3 1999/09/19 02:03:19 tjump Exp $ */
+/* $Id: feedback.c,v 1.4 1999/10/08 09:27:10 keithw Exp $ */
/*
* Mesa 3-D graphics library
#ifdef PC_HEADER
#include "all.h"
#else
+#ifndef XFree86Server
#include <assert.h>
#include <stdio.h>
+#else
+#include "GL/xf86glx.h"
+#endif
#include "context.h"
#include "enums.h"
#include "feedback.h"
-/* $Id: fog.c,v 1.1 1999/08/19 00:55:41 jtg Exp $ */
+/* $Id: fog.c,v 1.2 1999/10/08 09:27:10 keithw Exp $ */
/*
* Mesa 3-D graphics library
*/
+/* $XFree86: xc/lib/GL/mesa/src/fog.c,v 1.4 1999/04/04 00:20:24 dawes Exp $ */
+
#ifdef PC_HEADER
#include "all.h"
#else
+#ifndef XFree86Server
#include <math.h>
#include <stdlib.h>
+#else
+#include "GL/xf86glx.h"
+#endif
#include "context.h"
#include "fog.h"
#include "macros.h"
-/* $Id: get.c,v 1.3 1999/09/16 15:46:05 brianp Exp $ */
+/* $Id: get.c,v 1.4 1999/10/08 09:27:10 keithw Exp $ */
/*
* Mesa 3-D graphics library
*/
+/* $XFree86: xc/lib/GL/mesa/src/get.c,v 1.3 1999/04/04 00:20:25 dawes Exp $ */
+
#ifdef PC_HEADER
#include "all.h"
#else
+#ifndef XFree86Server
#include <assert.h>
#include <stdio.h>
#include <string.h>
+#else
+#include "GL/xf86glx.h"
+#endif
#include "context.h"
#include "enable.h"
#include "enums.h"
#include "mmath.h"
#include "types.h"
#include "vb.h"
-#ifdef XFree86Server
-#include "GL/xf86glx.h"
-#endif
#endif
-/* $Id: hash.c,v 1.1 1999/08/19 00:55:41 jtg Exp $ */
+/* $Id: hash.c,v 1.2 1999/10/08 09:27:10 keithw Exp $ */
/*
* Mesa 3-D graphics library
#ifdef PC_HEADER
#include "all.h"
#else
+#ifndef XFree86Server
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
-#include "hash.h"
-#ifdef XFree86Server
+#else
#include "GL/xf86glx.h"
#endif
+#include "hash.h"
#endif
-/* $Id: image.c,v 1.2 1999/09/15 13:56:44 brianp Exp $ */
+/* $Id: image.c,v 1.3 1999/10/08 09:27:10 keithw Exp $ */
/*
* Mesa 3-D graphics library
#ifdef PC_HEADER
#include "all.h"
#else
+#ifndef XFree86Server
#include <assert.h>
#include <stdlib.h>
#include <string.h>
+#else
+#include "GL/xf86glx.h"
+#endif
#include "context.h"
#include "image.h"
#include "macros.h"
-/* $Id: light.c,v 1.3 1999/09/30 11:18:22 keithw Exp $ */
+/* $Id: light.c,v 1.4 1999/10/08 09:27:11 keithw Exp $ */
/*
* Mesa 3-D graphics library
#ifdef PC_HEADER
#include "all.h"
#else
+#include <float.h>
+#ifndef XFree86Server
#include <assert.h>
#include <float.h>
#include <math.h>
#include <stdlib.h>
+#else
+#include "GL/xf86glx.h"
+#endif
#include <stdio.h>
#include "context.h"
#include "enums.h"
#include "types.h"
#include "vb.h"
#include "xform.h"
-#ifdef XFree86Server
-#include "GL/xf86glx.h"
-#endif
#endif
-/* $Id: lines.c,v 1.2 1999/09/18 20:41:23 keithw Exp $ */
+/* $Id: lines.c,v 1.3 1999/10/08 09:27:11 keithw Exp $ */
/*
* Mesa 3-D graphics library
#ifdef PC_HEADER
#include "all.h"
#else
+#ifndef XFree86Server
#include <assert.h>
+#else
+#include "GL/xf86glx.h"
+#endif
#include "context.h"
#include "depth.h"
#include "feedback.h"
-/* $Id: macros.h,v 1.1 1999/08/19 00:55:41 jtg Exp $ */
+/* $Id: macros.h,v 1.2 1999/10/08 09:27:11 keithw Exp $ */
/*
* Mesa 3-D graphics library
#ifndef MACROS_H
#define MACROS_H
-
+#if defined( XFree86LOADER ) && defined( XFree86Server )
+#include <GL/glx_ansic.h>
+#else
#include <math.h>
#include <string.h>
+#endif
#ifdef DEBUG
#endif
-#if defined(__GNUC__) || defined(__MWERKS__)
+#if defined(__GNUC__)
#define INLINE __inline__
#elif defined(__MSC__)
#define INLINE __inline
-/* $Id: matrix.c,v 1.4 1999/09/19 23:06:40 keithw Exp $ */
+/* $Id: matrix.c,v 1.5 1999/10/08 09:27:11 keithw Exp $ */
/*
* Mesa 3-D graphics library
#ifdef PC_HEADER
#include "all.h"
#else
+#ifndef XFree86Server
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#else
+#include "GL/xf86glx.h"
+#endif
#include "context.h"
#include "enums.h"
#include "macros.h"
/* Adapted from graphics gems II.
*/
-GLboolean invert_matrix_3d_general( GLmatrix *mat )
+static GLboolean invert_matrix_3d_general( GLmatrix *mat )
{
const GLfloat *in = mat->m;
GLfloat *out = mat->inv;
-/* $Id: matrix.h,v 1.1 1999/08/19 00:55:41 jtg Exp $ */
+/* $Id: matrix.h,v 1.2 1999/10/08 09:27:11 keithw Exp $ */
/*
* Mesa 3-D graphics library
extern void gl_matrix_analyze( GLmatrix *mat );
+extern void gl_MultMatrixd( GLcontext *ctx, const GLdouble *m );
+extern GLboolean gl_matrix_invert( GLmatrix *mat );
+extern void gl_print_matrix( const GLmatrix *m );
+
#endif
-/* $Id: pixel.c,v 1.1 1999/08/19 00:55:41 jtg Exp $ */
+/* $Id: pixel.c,v 1.2 1999/10/08 09:27:11 keithw Exp $ */
/*
* Mesa 3-D graphics library
#ifdef PC_HEADER
#include "all.h"
#else
+#ifndef XFree86Server
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
+#else
+#include "GL/xf86glx.h"
+#endif
#include "context.h"
#include "macros.h"
#include "pixel.h"
-/* $Id: points.c,v 1.2 1999/09/18 20:41:23 keithw Exp $ */
+/* $Id: points.c,v 1.3 1999/10/08 09:27:11 keithw Exp $ */
/*
* Mesa 3-D graphics library
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
+/* $XFree86: xc/lib/GL/mesa/src/points.c,v 1.4 1999/04/04 00:20:29 dawes Exp $ */
#ifdef PC_HEADER
#include "all.h"
#else
+#ifndef XFree86Server
+#include <math.h>
+#else
+#include "GL/xf86glx.h"
+#endif
#include "context.h"
#include "feedback.h"
#include "macros.h"
+#include "mmath.h"
#include "pb.h"
+#include "points.h"
#include "span.h"
#include "texstate.h"
#include "types.h"
#include "vb.h"
#include "mmath.h"
-#ifdef XFree86Server
-#include "GL/xf86glx.h"
-#endif
#endif
-/* $Id: polygon.c,v 1.3 1999/09/20 14:30:22 keithw Exp $ */
+/* $Id: polygon.c,v 1.4 1999/10/08 09:27:11 keithw Exp $ */
/*
* Mesa 3-D graphics library
*/
+/* $XFree86: xc/lib/GL/mesa/src/polygon.c,v 1.3 1999/04/04 00:20:29 dawes Exp $ */
+
#ifdef PC_HEADER
#include "all.h"
#else
+#ifndef XFree86Server
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+#else
+#include "GL/xf86glx.h"
+#endif
#include "context.h"
#include "image.h"
#include "enums.h"
-/* $Id: rastpos.c,v 1.1 1999/08/19 00:55:41 jtg Exp $ */
+/* $Id: rastpos.c,v 1.2 1999/10/08 09:27:11 keithw Exp $ */
/*
* Mesa 3-D graphics library
#ifdef PC_HEADER
#include "all.h"
#else
+#ifndef XFree86Server
#include <assert.h>
+#include <math.h>
+#else
+#include "GL/xf86glx.h"
+#endif
#include "clip.h"
+#include "context.h"
#include "feedback.h"
#include "light.h"
#include "macros.h"
#include "matrix.h"
#include "mmath.h"
+#include "rastpos.h"
#include "shade.h"
#include "types.h"
#include "xform.h"
-#include "context.h"
-#ifdef XFree86Server
-#include "GL/xf86glx.h"
#endif
-#endif
-
/*
-/* $Id: stencil.c,v 1.3 1999/09/19 02:03:19 tjump Exp $ */
+/* $Id: stencil.c,v 1.4 1999/10/08 09:27:11 keithw Exp $ */
/*
* Mesa 3-D graphics library
*/
+/* $XFree86: xc/lib/GL/mesa/src/stencil.c,v 1.3 1999/04/04 00:20:32 dawes Exp $ */
+
#ifdef PC_HEADER
#include "all.h"
#else
+#ifndef XFree86Server
#include <stdlib.h>
#include <string.h>
+#else
+#include "GL/xf86glx.h"
+#endif
#include "context.h"
#include "macros.h"
#include "pb.h"
-/* $Id: teximage.c,v 1.1 1999/08/19 00:55:41 jtg Exp $ */
+/* $Id: teximage.c,v 1.2 1999/10/08 09:27:11 keithw Exp $ */
/*
* Mesa 3-D graphics library
*/
+/* $XFree86: xc/lib/GL/mesa/src/teximage.c,v 1.3 1999/04/04 00:20:32 dawes Exp $ */
+
#ifdef PC_HEADER
#include "all.h"
#else
+#ifndef XFree86Server
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#else
+#include "GL/xf86glx.h"
+#endif
#include "context.h"
#include "image.h"
#include "macros.h"
-/* $Id: texobj.c,v 1.2 1999/09/30 11:18:22 keithw Exp $ */
+/* $Id: texobj.c,v 1.3 1999/10/08 09:27:11 keithw Exp $ */
/*
* Mesa 3-D graphics library
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-
+/* $XFree86: xc/lib/GL/mesa/src/texobj.c,v 1.3 1999/04/04 00:20:32 dawes Exp $ */
#ifdef PC_HEADER
#include "all.h"
#else
+#ifndef XFree86Server
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
+#else
+#include "GL/xf86glx.h"
+#endif
#include "context.h"
#include "enums.h"
#include "hash.h"
#include "texstate.h"
#include "texobj.h"
#include "types.h"
-#ifdef XFree86Server
-#include "GL/xf86glx.h"
-#endif
#endif
-/* $Id: texstate.c,v 1.2 1999/09/07 22:31:30 brianp Exp $ */
+/* $Id: texstate.c,v 1.3 1999/10/08 09:27:11 keithw Exp $ */
/*
* Mesa 3-D graphics library
#ifdef PC_HEADER
#include "all.h"
#else
+#ifndef XFree86Server
#include <assert.h>
#include <stdio.h>
+#else
+#include "GL/xf86glx.h"
+#endif
#include "context.h"
#include "enums.h"
#include "macros.h"
#include "texture.h"
#include "types.h"
#include "xform.h"
-#ifdef XFree86Server
-#include "GL/xf86glx.h"
-#endif
#endif
-/* $Id: varray.c,v 1.3 1999/09/07 22:31:30 brianp Exp $ */
+/* $Id: varray.c,v 1.4 1999/10/08 09:27:11 keithw Exp $ */
/*
* Mesa 3-D graphics library
#ifdef PC_HEADER
#include "all.h"
#else
+#ifndef XFree86Server
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+#else
+#include "GL/xf86glx.h"
+#endif
#include "context.h"
#include "api.h"
#include "cva.h"
#endif
#endif
+#if defined(GLX_DIRECT_RENDERING) && !defined(XFree86Server) && !defined(GLX_USE_DLOPEN)
+#define NEED_MESA_FUNCS_WRAPPED
+#include "mesa_api.h"
+#endif
+
void GLAPIENTRY glVertexPointer(CTX_ARG GLint size, GLenum type, GLsizei stride,
const GLvoid *ptr )
-/* $Id: varray.h,v 1.2 1999/09/09 23:48:02 brianp Exp $ */
+/* $Id: varray.h,v 1.3 1999/10/08 09:27:11 keithw Exp $ */
/*
* Mesa 3-D graphics library
GLsizei stride, const GLboolean *ptr );
+extern void gl_GetPointerv( GLcontext *ctx, GLenum pname, GLvoid **params );
+
+
+
extern void gl_DrawArrays( GLcontext *ctx,
GLenum mode, GLint first, GLsizei count );
GLuint end, GLsizei count, GLenum type,
const GLvoid *indices );
-
extern void gl_save_DrawRangeElements( GLcontext *ctx, GLenum mode,
GLuint start, GLuint end, GLsizei count,
GLenum type, const GLvoid *indices );