Renamed struct gl_context to struct __GLcontextRec.
Include glcore.h, setup GL imports/exports.
Replaced gl_ prefix with _mesa_ prefix in context.[ch] functions.
GLcontext's Visual field is no longer a pointer.
-# $Id: Makefile.X11,v 1.23 2000/09/26 15:27:23 brianp Exp $
+# $Id: Makefile.X11,v 1.24 2000/09/26 20:53:53 brianp Exp $
# Mesa 3-D graphics library
# Version: 3.5
hint.c \
image.c \
imaging.c \
+ imports.c \
light.c \
lines.c \
logic.c \
\r
visual->DBFlag = dbFlag;\r
visual->Depth = depth;\r
- visual->GLVisual = gl_create_visual(GL_TRUE, /* rgb mode */\r
- GL_TRUE, /* software alpha */\r
- dbFlag, /* db_flag */\r
- GL_FALSE, /* stereo */\r
- depthSize, /* depth bits */\r
- stencilSize,/* stencil bits */\r
- accumSize, /* accum bits */\r
- 0, /* index bits */\r
- redBits, greenBits, blueBits, 0);\r
+ visual->GLVisual = _mesa_create_visual(GL_TRUE, /* rgb mode */\r
+ dbFlag, /* db_flag */\r
+ GL_FALSE, /* stereo */\r
+ redBits, greenBits, blueBits, 8,\r
+ 0, /* index bits */\r
+ depthSize, /* depth bits */\r
+ stencilSize,/* stencil bits */\r
+ accumSize, /* accum bits */\r
+ accumSize, /* accum bits */\r
+ accumSize, /* accum bits */\r
+ accumSize, /* accum bits */\r
+ 1 );\r
if (!visual->GLVisual)\r
{\r
free(visual);\r
\r
void AMesaDestroyVisual(AMesaVisual visual)\r
{\r
- gl_destroy_visual(visual->GLVisual);\r
- free(visual);\r
+ _mesa_destroy_visual(visual->GLVisual);\r
+ free(visual);\r
}\r
\r
\r
}\r
}\r
\r
- buffer->GLBuffer = gl_create_framebuffer(visual->GLVisual);\r
+ buffer->GLBuffer = _mesa_create_framebuffer(visual->GLVisual);\r
if (!buffer->GLBuffer)\r
{\r
if (buffer->Background) destroy_bitmap(buffer->Background);\r
\r
\r
void AMesaDestroyBuffer(AMesaBuffer buffer)\r
- {\r
- if (buffer->Screen) destroy_bitmap(buffer->Screen);\r
- if (buffer->Background) destroy_bitmap(buffer->Background);\r
- gl_destroy_framebuffer(buffer->GLBuffer);\r
- free(buffer);\r
- }\r
+{\r
+ if (buffer->Screen) destroy_bitmap(buffer->Screen);\r
+ if (buffer->Background) destroy_bitmap(buffer->Background);\r
+ _mesa_destroy_framebuffer(buffer->GLBuffer);\r
+ free(buffer);\r
+}\r
\r
\r
AMesaContext AMesaCreateContext(AMesaVisual visual,\r
context->Buffer = NULL;\r
context->ClearColor = 0;\r
context->CurrentColor = 0;\r
- context->GLContext = gl_create_context(visual->GLVisual,\r
+ context->GLContext = _mesa_create_context(visual->GLVisual,\r
share ? share->GLContext : NULL,\r
(void*)context,\r
direct);\r
\r
\r
void AMesaDestroyContext(AMesaContext context)\r
- {\r
- gl_destroy_context(context->GLContext);\r
- free(context);\r
- }\r
+{\r
+ _mesa_destroy_context(context->GLContext);\r
+ free(context);\r
+}\r
\r
\r
GLboolean AMesaMakeCurrent(AMesaContext context, AMesaBuffer buffer)\r
- {\r
- if (context && buffer)\r
- {\r
- set_color_depth(context->Visual->Depth);\r
- if (set_gfx_mode(GFX_AUTODETECT, buffer->Width, buffer->Height, 0, 0) != 0)\r
- return GL_FALSE;\r
-\r
- context->Buffer = buffer;\r
- buffer->Screen = screen;\r
- buffer->Active = buffer->Background ? buffer->Background : screen;\r
+{\r
+ if (context && buffer) {\r
+ set_color_depth(context->Visual->Depth);\r
+ if (set_gfx_mode(GFX_AUTODETECT, buffer->Width, buffer->Height, 0, 0) != 0)\r
+ return GL_FALSE;\r
+\r
+ context->Buffer = buffer;\r
+ buffer->Screen = screen;\r
+ buffer->Active = buffer->Background ? buffer->Background : screen;\r
\r
- setup_dd_pointers(context->GLContext);\r
- gl_make_current(context->GLContext, buffer->GLBuffer);\r
- gl_Viewport(context->GLContext, 0, 0, buffer->Width, buffer->Height);\r
- }\r
- else\r
- {\r
- destroy_bitmap(context->Buffer->Screen);\r
- context->Buffer->Screen = NULL;\r
- context->Buffer->Active = NULL;\r
- context->Buffer = NULL;\r
- gl_make_current(NULL, NULL);\r
- }\r
-\r
- return GL_TRUE;\r
- }\r
+ setup_dd_pointers(context->GLContext);\r
+ _mesa_make_current(context->GLContext, buffer->GLBuffer);\r
+ gl_Viewport(context->GLContext, 0, 0, buffer->Width, buffer->Height);\r
+ }\r
+ else {\r
+ destroy_bitmap(context->Buffer->Screen);\r
+ context->Buffer->Screen = NULL;\r
+ context->Buffer->Active = NULL;\r
+ context->Buffer = NULL;\r
+ _mesa_make_current(NULL, NULL);\r
+ }\r
+\r
+ return GL_TRUE;\r
+}\r
\r
\r
void AMesaSwapBuffers(AMesaBuffer buffer)\r
- {\r
- if (buffer->Background)\r
- {\r
- blit(buffer->Background, buffer->Screen,\r
- 0, 0, 0, 0,\r
- buffer->Width, buffer->Height);\r
- }\r
- }\r
+{\r
+ if (buffer->Background) {\r
+ blit(buffer->Background, buffer->Screen,\r
+ 0, 0, 0, 0,\r
+ buffer->Width, buffer->Height);\r
+ }\r
+}\r
-/* $Id: GLView.cpp,v 1.2 2000/03/19 01:13:13 brianp Exp $ */
+/* $Id: GLView.cpp,v 1.3 2000/09/26 20:54:09 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.5
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2000 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"),
/*
* $Log: GLView.cpp,v $
+ * Revision 1.3 2000/09/26 20:54:09 brianp
+ * First batch of OpenGL SI related changes:
+ * Renamed struct gl_context to struct __GLcontextRec.
+ * Include glcore.h, setup GL imports/exports.
+ * Replaced gl_ prefix with _mesa_ prefix in context.[ch] functions.
+ * GLcontext's Visual field is no longer a pointer.
+ *
* Revision 1.2 2000/03/19 01:13:13 brianp
* updated for Mesa 3.3
*
AuxInfo::~AuxInfo()
{
- gl_destroy_visual(mVisual);
- gl_destroy_framebuffer(mBuffer);
- gl_destroy_context(mContext);
+ _mesa_destroy_visual(mVisual);
+ _mesa_destroy_framebuffer(mBuffer);
+ _mesa_destroy_context(mContext);
}
void AuxInfo::MakeCurrent()
{
UpdateState(mContext);
- gl_make_current(mContext, mBuffer);
+ _mesa_make_current(mContext, mBuffer);
}
AuxInfo *aux = new AuxInfo;
// examine option flags and create gl_context struct
- GLvisual *visual = gl_create_visual( rgbFlag, alphaFlag,
- dblFlag, stereoFlag,
- depth, stencil, accum, index,
- red, green, blue, alpha);
+ GLvisual *visual = _mesa__create_visual( rgbFlag,
+ dblFlag,
+ stereoFlag,
+ red, green, blue, alpha,
+ index,
+ depth,
+ stencil,
+ accum, accum, accum, accum,
+ 1
+ );
// create core framebuffer
- GLframebuffer *buffer = gl_create_framebuffer(visual,
+ GLframebuffer *buffer = _mesa_create_framebuffer(visual,
depth > 0 ? GL_TRUE : GL_FALSE,
stencil > 0 ? GL_TRUE: GL_FALSE,
accum > 0 ? GL_TRUE : GL_FALSE,
// create core context
const GLboolean direct = GL_TRUE;
- GLcontext *ctx = gl_create_context( visual, NULL, aux, direct );
+ GLcontext *ctx = _mesa_create_context( visual, NULL, aux, direct );
aux->Init(this, ctx, visual, buffer );
{
AuxInfo *aux = (AuxInfo *) m_gc;
assert(aux);
- // Could call gl_make_current(NULL, NULL) but it would just
+ // Could call _mesa_make_current(NULL, NULL) but it would just
// hinder performance
}
/*========================================================================*/\r
/* Do all core Mesa stuff. */\r
/*========================================================================*/\r
- pD3DDefault->gl_visual = gl_create_visual( TRUE,\r
- GL_FALSE, /* software alpha */\r
- FALSE, /* db_flag */\r
- GL_FALSE, /* stereo */\r
- 16, /* depth_bits */\r
- 8, /* stencil_bits */\r
- 8, /* accum_bits */\r
- 0, /* index bits */\r
- 8,8,8,8 ); /* r, g, b, a bits */\r
+ pD3DDefault->gl_visual = _mesa_create_visual( TRUE,\r
+ FALSE, /* db_flag */\r
+ GL_FALSE, /* stereo */\r
+ 8,8,8,8, /* r, g, b, a bits */\r
+ 0, /* index bits */\r
+ 16, /* depth_bits */\r
+ 8, /* stencil_bits */\r
+ 8,8,8,8, /* accum_bits */\r
+ 1 );\r
\r
if ( pD3DDefault->gl_visual == NULL) \r
{\r
}\r
\r
/* Allocate a new Mesa context */\r
- pD3DDefault->gl_ctx = gl_create_context( pD3DDefault->gl_visual, NULL, pD3DDefault, GL_TRUE );\r
+ pD3DDefault->gl_ctx = _mesa_create_context( pD3DDefault->gl_visual, NULL, pD3DDefault, GL_TRUE );\r
if ( pD3DDefault->gl_ctx == NULL ) \r
{\r
- gl_destroy_visual( pD3DDefault->gl_visual );\r
+ _mesa_destroy_visual( pD3DDefault->gl_visual );\r
FREE( pD3DDefault );\r
return FALSE;\r
}\r
\r
/* Allocate a new Mesa frame buffer */\r
- pD3DDefault->gl_buffer = gl_create_framebuffer( pD3DDefault->gl_visual );\r
+ pD3DDefault->gl_buffer = _mesa_create_framebuffer( pD3DDefault->gl_visual );\r
if ( pD3DDefault->gl_buffer == NULL )\r
{\r
- gl_destroy_visual( pD3DDefault->gl_visual );\r
- gl_destroy_context( pD3DDefault->gl_ctx );\r
+ _mesa_destroy_visual( pD3DDefault->gl_visual );\r
+ _mesa_destroy_context( pD3DDefault->gl_ctx );\r
FREE( pD3DDefault );\r
return FALSE;\r
}\r
SetupDDPointers( pD3DDefault->gl_ctx );\r
- gl_make_current( pD3DDefault->gl_ctx, pD3DDefault->gl_buffer );\r
+ _mesa_make_current( pD3DDefault->gl_ctx, pD3DDefault->gl_buffer );\r
\r
return TRUE;\r
}\r
/*========================================================================*/\r
\r
/* TODO: support more then one visual. */\r
- pNewContext->gl_visual = gl_create_visual( TRUE,\r
- GL_TRUE, /* software alpha */\r
- TRUE, /* db_flag */\r
- GL_FALSE, /* stereo */\r
- 16, /* depth_bits */\r
- 8, /* stencil_bits */\r
- 8, /* accum_bits */\r
- 0, /* index bits */\r
- 8,8,8,8 ); /* r, g, b, a bits */\r
+ pNewContext->gl_visual = _mesa_create_visual( TRUE,\r
+ TRUE, /* db_flag */\r
+ GL_FALSE, /* stereo */\r
+ 8,8,8,8, /* r, g, b, a bits */\r
+ 0, /* index bits */\r
+ 16, /* depth_bits */\r
+ 8, /* stencil_bits */\r
+ 16,16,16,16,/* accum_bits */\r
+ 1 );\r
if ( pNewContext->gl_visual == NULL) \r
{\r
FREE( pNewContext );\r
}\r
\r
/* Allocate a new Mesa context */\r
- pNewContext->gl_ctx = gl_create_context( pNewContext->gl_visual, NULL, pNewContext, GL_TRUE );\r
+ pNewContext->gl_ctx = _mesa_create_context( pNewContext->gl_visual, NULL, pNewContext, GL_TRUE );\r
if ( pNewContext->gl_ctx == NULL ) \r
{\r
- gl_destroy_visual( pNewContext->gl_visual );\r
+ _mesa_destroy_visual( pNewContext->gl_visual );\r
FREE( pNewContext );\r
SetLastError( 0 );\r
return (HGLRC)NULL;\r
}\r
\r
/* Allocate a new Mesa frame buffer */\r
- pNewContext->gl_buffer = gl_create_framebuffer( pNewContext->gl_visual );\r
+ pNewContext->gl_buffer = _mesa_create_framebuffer( pNewContext->gl_visual );\r
if ( pNewContext->gl_buffer == NULL )\r
{\r
- gl_destroy_visual( pNewContext->gl_visual );\r
- gl_destroy_context( pNewContext->gl_ctx );\r
+ _mesa_destroy_visual( pNewContext->gl_visual );\r
+ _mesa_destroy_context( pNewContext->gl_ctx );\r
FREE( pNewContext );\r
SetLastError( 0 );\r
return (HGLRC)NULL;\r
/* Let Mesa-3.0 we have a new context. */\r
/*=====================================*/\r
SetupDDPointers( pContext->gl_ctx );\r
- gl_make_current( pContext->gl_ctx, pContext->gl_buffer );\r
+ _mesa_make_current( pContext->gl_ctx, pContext->gl_buffer );\r
\r
/* We are done so set the internal current context. */\r
if ( pContext != pD3DDefault )\r
\r
/* Update Mesa as we might have changed from SW <-> HW. */\r
SetupDDPointers( pContext->gl_ctx );\r
- gl_make_current( pContext->gl_ctx, pContext->gl_buffer );\r
+ _mesa_make_current( pContext->gl_ctx, pContext->gl_buffer );\r
\r
/* If we are in HW we need to load the current texture if there is one already. */\r
// if ( (ctx->Texture.Set[ctx->Texture.CurrentSet].Current != NULL) &&\r
/* Free the Mesa stuff. */\r
if ( pContext->gl_visual ) \r
{\r
- gl_destroy_visual( pContext->gl_visual );\r
+ _mesa_destroy_visual( pContext->gl_visual );\r
pContext->gl_visual = NULL;\r
}\r
if ( pContext->gl_buffer ) \r
{\r
- gl_destroy_framebuffer( pContext->gl_buffer );\r
+ _mesa_destroy_framebuffer( pContext->gl_buffer );\r
pContext->gl_buffer = NULL;\r
}\r
if ( pContext->gl_ctx ) \r
{\r
- gl_destroy_context( pContext->gl_ctx );\r
+ _mesa_destroy_context( pContext->gl_ctx );\r
pContext->gl_ctx = NULL;\r
}\r
\r
-/* $Id: dosmesa.c,v 1.1 1999/08/19 00:55:41 jtg Exp $ */\r
+/* $Id: dosmesa.c,v 1.2 2000/09/26 20:54:10 brianp Exp $ */\r
\r
/*\r
* Mesa 3-D graphics library\r
\r
/*\r
* $Log: dosmesa.c,v $
- * Revision 1.1 1999/08/19 00:55:41 jtg
- * Initial revision
+ * Revision 1.2 2000/09/26 20:54:10 brianp
+ * First batch of OpenGL SI related changes:
+ * Renamed struct gl_context to struct __GLcontextRec.
+ * Include glcore.h, setup GL imports/exports.
+ * Replaced gl_ prefix with _mesa_ prefix in context.[ch] functions.
+ * GLcontext's Visual field is no longer a pointer.
+ *
+ * Revision 1.1.1.1 1999/08/19 00:55:41 jtg
+ * Imported sources
*
* Revision 1.2 1999/03/28 21:11:57 brianp
* updated SetBuffer driver function
return NULL;\r
}\r
\r
- ctx->gl_vis = gl_create_visual( rgb_flag,\r
- alpha_flag,\r
- db_flag,\r
- 16, /* depth_size */\r
- 8, /* stencil_size */\r
- 16, /* accum_size */\r
- index_bits,\r
- redscale,\r
- greenscale,\r
- bluescale,\r
- alphascale,\r
- redbits, greenbits,\r
- bluebits, alphabits);\r
-\r
- ctx->gl_ctx = gl_create_context( ctx->gl_vis,\r
+ ctx->gl_vis = _mesa_create_visual( rgb_flag,\r
+ db_flag,\r
+ GL_FALSE, /* stereo */\r
+ redbits,\r
+ greenbits,\r
+ bluebits,\r
+ alphabits,\r
+ index_bits,\r
+ 16, /* depth_size */\r
+ 8, /* stencil_size */\r
+ 16, 16, 16, 16, /* accum_size */\r
+ 1 );
+\r
+ ctx->gl_ctx = _mesa_create_context( ctx->gl_vis,\r
NULL, /* share list context */\r
(void *) ctx\r
);\r
\r
- ctx->gl_buffer = gl_create_framebuffer( ctx->gl_vis );\r
+ ctx->gl_buffer = _mesa_create_framebuffer( ctx->gl_vis );\r
\r
ctx->index = 1;\r
ctx->red = ctx->green = ctx->blue = 255;\r
void DOSMesaDestroyContext( DOSMesaContext ctx )\r
{\r
if (ctx) {\r
- gl_destroy_visual( ctx->gl_vis );\r
- gl_destroy_context( ctx->gl_ctx );\r
- gl_destroy_framebuffer( ctx->gl_buffer );\r
+ _mesa_destroy_visual( ctx->gl_vis );\r
+ _mesa_destroy_context( ctx->gl_ctx );\r
+ _mesa_destroy_framebuffer( ctx->gl_buffer );\r
free( ctx );\r
if (ctx==DOSMesa) {\r
DOSMesa = NULL;\r
void DOSMesaMakeCurrent( DOSMesaContext ctx )\r
{\r
DOSMesa = ctx;\r
- gl_make_current( ctx->gl_ctx, ctx->gl_buffer );\r
+ _mesa_make_current( ctx->gl_ctx, ctx->gl_buffer );\r
DOSmesa_setup_DD_pointers( ctx->gl_ctx );\r
\r
if (ctx->width==0 || ctx->height==0) {\r
ctx->viewport_init = GL_FALSE;
ctx->gl_vis->DBflag = GL_FALSE;
- ctx->gl_ctx = gl_create_context(ctx->gl_vis, NULL, (void *)ctx, GL_TRUE);
+ ctx->gl_ctx = _mesa_create_context(ctx->gl_vis, NULL, (void *)ctx, GL_TRUE);
if (!ctx->gl_ctx)
return NULL;
{
if (ctx)
{
- gl_destroy_visual(ctx->gl_vis);
- gl_destroy_context(ctx->gl_ctx);
- gl_destroy_framebuffer(ctx->gl_buffer);
+ _mesa_destroy_visual(ctx->gl_vis);
+ _mesa_destroy_context(ctx->gl_ctx);
+ _mesa_destroy_framebuffer(ctx->gl_buffer);
if (ctx == GGIMesa)
GGIMesa = NULL;
if (ctx->ggi_vis)
changed(vis, GGI_CHG_APILIST);
if (ctx->gl_vis)
- gl_destroy_visual(ctx->gl_vis);
+ _mesa_destroy_visual(ctx->gl_vis);
if (ctx->gl_buffer)
gl_destroy_framebuffer(ctx->gl_buffer);
if (err)
return -1;
- ctx->gl_vis = gl_create_visual(info.rgb_flag,
- info.alpha_flag,
- info.db_flag,
- GL_FALSE,
- info.depth_bits,
- info.stencil_bits,
- info.accum_bits,
- info.index_bits,
- info.red_bits, info.green_bits,
- info.blue_bits, info.alpha_bits);
+ ctx->gl_vis = _mesa_create_visual(info.rgb_flag,
+ info.db_flag,
+ GL_FALSE, /*stereo*/
+ info.red_bits, info.green_bits,
+ info.blue_bits, info.alpha_bits,
+ info.index_bits,
+ info.depth_bits,
+ info.stencil_bits,
+ info.accum_bits,
+ info.accum_bits,
+ info.accum_bits,
+ info.accum_bits,
+ 1);
if (!ctx->gl_vis)
{
fprintf(stderr, "Can't create gl_visual!\n");
return -1;
}
- ctx->gl_buffer = gl_create_framebuffer(ctx->gl_vis,
+ ctx->gl_buffer = _mesa_create_framebuffer(ctx->gl_vis,
ctx->gl_vis->DepthBits > 0,
ctx->gl_vis->StencilBits > 0,
ctx->gl_vis->AccumRedBits > 0,
ctx->gl_ctx->Color.DrawBuffer = (db_flag) ? GL_BACK : GL_FRONT;
if (GGIMesa == ctx)
- gl_make_current(ctx->gl_ctx, ctx->gl_buffer);
+ _mesa_make_current(ctx->gl_ctx, ctx->gl_buffer);
if (rgb_flag && mode.graphtype==GT_8BIT)
{
return;
GGIMesa = ctx;
- gl_make_current(ctx->gl_ctx, ctx->gl_buffer);
+ _mesa_make_current(ctx->gl_ctx, ctx->gl_buffer);
if (!ctx->viewport_init)
{
fprintf(stderr,"Voodoo Glide screen size: %dx%d\n",
(int)FX_grSstScreenWidth(),(int)FX_grSstScreenHeight());
- 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 */
+ fxMesa->glVis=_mesa_create_visual(GL_TRUE, /* RGB mode */
+ doubleBuffer,
+ GL_FALSE, /* stereo */
+ 5,6,5,0, /* RGBA bits */
+ 0, /* index bits */
+ depthSize, /* depth_size */
+ stencilSize, /* stencil_size */
+ accumSize, accumSize, accumSize, accumSize,
+ 1 );
if (!fxMesa->glVis) {
- errorstr = "gl_create_visual";
+ errorstr = "_mesa_create_visual";
goto errorhandler;
}
- ctx = fxMesa->glCtx=gl_create_context(fxMesa->glVis,
+ ctx = fxMesa->glCtx=_mesa_create_context(fxMesa->glVis,
shareCtx, /* share list context */
(void *) fxMesa, GL_TRUE);
if (!ctx) {
- errorstr = "gl_create_context";
+ errorstr = "_mesa_create_context";
goto errorhandler;
}
}
- fxMesa->glBuffer=gl_create_framebuffer(fxMesa->glVis,
+ fxMesa->glBuffer=_mesa_create_framebuffer(fxMesa->glVis,
GL_FALSE, /* no software depth */
fxMesa->glVis->StencilBits > 0,
fxMesa->glVis->AccumRedBits > 0,
fxMesa->glVis->AlphaBits > 0 );
if (!fxMesa->glBuffer) {
- errorstr = "gl_create_framebuffer";
+ errorstr = "_mesa_create_framebuffer";
goto errorhandler;
}
if (fxMesa->fogTable)
free(fxMesa->fogTable);
if (fxMesa->glBuffer)
- gl_destroy_framebuffer(fxMesa->glBuffer);
+ _mesa_destroy_framebuffer(fxMesa->glBuffer);
if (fxMesa->glVis)
- gl_destroy_visual(fxMesa->glVis);
+ _mesa_destroy_visual(fxMesa->glVis);
if (fxMesa->glCtx)
- gl_destroy_context(fxMesa->glCtx);
+ _mesa_destroy_context(fxMesa->glCtx);
free(fxMesa);
}
}
if(fxMesa) {
- gl_destroy_visual(fxMesa->glVis);
- gl_destroy_context(fxMesa->glCtx);
- gl_destroy_framebuffer(fxMesa->glBuffer);
+ _mesa_destroy_visual(fxMesa->glVis);
+ _mesa_destroy_context(fxMesa->glCtx);
+ _mesa_destroy_framebuffer(fxMesa->glBuffer);
glbTotNumCtx--;
}
if(!fxMesa) {
- gl_make_current(NULL,NULL);
+ _mesa_make_current(NULL,NULL);
fxMesaCurrentCtx=NULL;
if (MESA_VERBOSE&VERBOSE_DRIVER) {
/* if this context is already the current one, we can return early */
if (fxMesaCurrentCtx == fxMesa
- && fxMesaCurrentCtx->glCtx == gl_get_current_context()) {
+ && fxMesaCurrentCtx->glCtx == _mesa_get_current_context()) {
if (MESA_VERBOSE&VERBOSE_DRIVER) {
fprintf(stderr,"fxmesa: fxMesaMakeCurrent(fxMesaCurrentCtx==fxMesa) End\n");
}
grSstSelect(fxMesa->board);
grGlideSetState((GrState*)fxMesa->state);
- gl_make_current(fxMesa->glCtx,fxMesa->glBuffer);
+ _mesa_make_current(fxMesa->glCtx,fxMesa->glBuffer);
fxSetupDDPointers(fxMesa->glCtx);
fxMesa->glCtx->NrPipelineStages);
/* Run the config file */
- gl_context_initialize( fxMesa->glCtx );
+ _mesa_context_initialize( fxMesa->glCtx );
return 1;
}
-/* $Id: osmesa.c,v 1.20 2000/09/08 16:41:39 brianp Exp $ */
+/* $Id: osmesa.c,v 1.21 2000/09/26 20:54:12 brianp Exp $ */
/*
* Mesa 3-D graphics library
*
* Note on thread safety: this driver is thread safe. All
* functions are reentrant. The notion of current context is
- * managed by the core gl_make_current() and gl_get_current_context()
+ * managed by the core _mesa_make_current() and _mesa_get_current_context()
* functions. Those functions are thread-safe.
*/
gl_extensions_enable(&(osmesa->gl_ctx), "GL_ARB_texture_cube_map");
gl_extensions_enable(&(osmesa->gl_ctx), "GL_EXT_texture_env_combine");
- osmesa->gl_buffer = gl_create_framebuffer( osmesa->gl_visual,
- osmesa->gl_visual->DepthBits > 0,
- osmesa->gl_visual->StencilBits > 0,
- osmesa->gl_visual->AccumRedBits > 0,
- osmesa->gl_visual->AlphaBits > 0 );
+ osmesa->gl_buffer = _mesa_create_framebuffer( osmesa->gl_visual,
+ osmesa->gl_visual->DepthBits > 0,
+ osmesa->gl_visual->StencilBits > 0,
+ osmesa->gl_visual->AccumRedBits > 0,
+ osmesa->gl_visual->AlphaBits > 0 );
if (!osmesa->gl_buffer) {
- gl_destroy_visual( osmesa->gl_visual );
- gl_free_context_data( &osmesa->gl_ctx );
+ _mesa_destroy_visual( osmesa->gl_visual );
+ _mesa_free_context_data( &osmesa->gl_ctx );
FREE(osmesa);
return NULL;
}
void GLAPIENTRY OSMesaDestroyContext( OSMesaContext ctx )
{
if (ctx) {
- gl_destroy_visual( ctx->gl_visual );
- gl_destroy_framebuffer( ctx->gl_buffer );
- gl_free_context_data( &ctx->gl_ctx );
+ _mesa_destroy_visual( ctx->gl_visual );
+ _mesa_destroy_framebuffer( ctx->gl_buffer );
+ _mesa_free_context_data( &ctx->gl_ctx );
FREE( ctx );
}
}
}
osmesa_update_state( &ctx->gl_ctx );
- gl_make_current( &ctx->gl_ctx, ctx->gl_buffer );
+ _mesa_make_current( &ctx->gl_ctx, ctx->gl_buffer );
ctx->buffer = buffer;
ctx->width = width;
OSMesaContext GLAPIENTRY OSMesaGetCurrentContext( void )
{
- GLcontext *ctx = gl_get_current_context();
+ GLcontext *ctx = _mesa_get_current_context();
if (ctx)
return (OSMesaContext) ctx;
else
if (ctx->RasterMask==DEPTH_BIT
&& ctx->Depth.Func==GL_LESS
&& ctx->Depth.Mask==GL_TRUE
- && ctx->Visual->DepthBits == DEFAULT_SOFTWARE_DEPTH_BITS) {
+ && ctx->Visual.DepthBits == DEFAULT_SOFTWARE_DEPTH_BITS) {
switch(osmesa->format) {
case OSMESA_RGBA:
case OSMESA_BGRA:
if (ctx->RasterMask==(DEPTH_BIT|BLEND_BIT)
&& ctx->Depth.Func==GL_LESS
&& ctx->Depth.Mask==GL_TRUE
- && ctx->Visual->DepthBits == DEFAULT_SOFTWARE_DEPTH_BITS
+ && ctx->Visual.DepthBits == DEFAULT_SOFTWARE_DEPTH_BITS
&& ctx->Color.BlendSrcRGB==GL_SRC_ALPHA
&& ctx->Color.BlendDstRGB==GL_ONE_MINUS_SRC_ALPHA
&& ctx->Color.BlendSrcA==GL_SRC_ALPHA
if (ctx->RasterMask==(DEPTH_BIT|BLEND_BIT)
&& ctx->Depth.Func==GL_LESS
&& ctx->Depth.Mask==GL_FALSE
- && ctx->Visual->DepthBits == DEFAULT_SOFTWARE_DEPTH_BITS
+ && ctx->Visual.DepthBits == DEFAULT_SOFTWARE_DEPTH_BITS
&& ctx->Color.BlendSrcRGB==GL_SRC_ALPHA
&& ctx->Color.BlendDstRGB==GL_ONE_MINUS_SRC_ALPHA
&& ctx->Color.BlendSrcA==GL_SRC_ALPHA
if (ctx->RasterMask==DEPTH_BIT
&& ctx->Depth.Func==GL_LESS
&& ctx->Depth.Mask==GL_TRUE
- && ctx->Visual->DepthBits == DEFAULT_SOFTWARE_DEPTH_BITS
+ && ctx->Visual.DepthBits == DEFAULT_SOFTWARE_DEPTH_BITS
&& osmesa->format!=OSMESA_COLOR_INDEX) {
if (ctx->Light.ShadeModel==GL_SMOOTH) {
return smooth_rgba_z_triangle;
-/* $Id: svgamesa.c,v 1.5 2000/03/31 01:07:14 brianp Exp $ */
+/* $Id: svgamesa.c,v 1.6 2000/09/26 20:54:12 brianp Exp $ */
/*
* Mesa 3-D graphics library
#ifndef DEV
GLboolean rgb_flag;
GLfloat redscale, greenscale, bluescale, alphascale;
- GLboolean alpha_flag = GL_FALSE;
GLint index_bits;
GLint redbits, greenbits, bluebits, alphabits;
/* determine if we're in RGB or color index mode */
return NULL;
}
- ctx->gl_vis = gl_create_visual( rgb_flag,
- alpha_flag,
- doubleBuffer,
- GL_FALSE, /* stereo */
- 16, /* depth_size */
- 8, /* stencil_size */
- 16, /* accum_size */
- index_bits,
- redbits, greenbits,
- bluebits, alphabits );
-
- ctx->gl_ctx = gl_create_context( ctx->gl_vis,
- NULL, /* share list context */
- (void *) ctx, GL_TRUE );
-
- ctx->gl_buffer = gl_create_framebuffer( ctx->gl_vis,
- ctx->gl_vis->DepthBits > 0,
- ctx->gl_vis->StencilBits > 0,
- ctx->gl_vis->AccumRedBits > 0,
- ctx->gl_vis->AlphaBits > 0 );
+ ctx->gl_vis = _mesa_create_visual( rgb_flag,
+ doubleBuffer,
+ GL_FALSE, /* stereo */
+ redbits, greenbits,
+ bluebits, alphabits,
+ index_bits,
+ 16, /* depth_size */
+ 8, /* stencil_size */
+ 16, 16, 16, 16, /* accum_size */
+ 1 /* samples */
+ );
+
+ ctx->gl_ctx = _mesa_create_context( ctx->gl_vis,
+ NULL, /* share list context */
+ (void *) ctx, GL_TRUE );
+
+ ctx->gl_buffer = _mesa_create_framebuffer( ctx->gl_vis,
+ ctx->gl_vis->DepthBits > 0,
+ ctx->gl_vis->StencilBits > 0,
+ ctx->gl_vis->AccumRedBits > 0,
+ ctx->gl_vis->AlphaBits > 0 );
ctx->index = 1;
ctx->red = ctx->green = ctx->blue = 255;
{
#ifndef DEV
if (ctx) {
- gl_destroy_visual( ctx->gl_vis );
- gl_destroy_context( ctx->gl_ctx );
- gl_destroy_framebuffer( ctx->gl_buffer );
+ _mesa_destroy_visual( ctx->gl_vis );
+ _mesa_destroy_context( ctx->gl_ctx );
+ _mesa_destroy_framebuffer( ctx->gl_buffer );
free( ctx );
if (ctx==SVGAMesa) {
SVGAMesa = NULL;
#ifndef DEV
SVGAMesa = ctx;
svgamesa_update_state( ctx->gl_ctx );
- gl_make_current( ctx->gl_ctx, ctx->gl_buffer );
+ _mesa_make_current( ctx->gl_ctx, ctx->gl_buffer );
if (ctx->width==0 || ctx->height==0) {
/* setup initial viewport */
-/* $Id: wmesa.c,v 1.7 2000/09/12 15:46:43 brianp Exp $ */
+/* $Id: wmesa.c,v 1.8 2000/09/26 20:54:13 brianp Exp $ */
/*
* Windows (Win32) device driver for Mesa 3.4
#endif
- c->gl_visual = gl_create_visual(rgb_flag,
- GL_FALSE, /* software alpha */
- db_flag, /* db_flag */
- GL_FALSE, /* stereo */
- 16, /* depth_bits */
- 8, /* stencil_bits */
- 8, /* accum_bits */
- 0, /* index bits */
- 8,8,8,8 ); /* r, g, b, a bits */
+ c->gl_visual = _mesa_create_visual(rgb_flag,
+ db_flag, /* db_flag */
+ GL_FALSE, /* stereo */
+ 8,8,8,8, /* r, g, b, a bits */
+ 0, /* index bits */
+ 16, /* depth_bits */
+ 8, /* stencil_bits */
+ 16,16,16,16,/* accum_bits */
+ 1);
if (!c->gl_visual) {
return NULL;
}
/* allocate a new Mesa context */
- c->gl_ctx = gl_create_context( c->gl_visual, NULL, c, GL_TRUE);
+ c->gl_ctx = _mesa_create_context( c->gl_visual, NULL, c, GL_TRUE);
if (!c->gl_ctx) {
- gl_destroy_visual( c->gl_visual );
+ _mesa_destroy_visual( c->gl_visual );
free(c);
return NULL;
}
- c->gl_buffer = gl_create_framebuffer( c->gl_visual,
+ c->gl_buffer = _mesa_create_framebuffer( c->gl_visual,
c->gl_visual->DepthBits > 0,
c->gl_visual->StencilBits > 0,
c->gl_visual->AccumRedBits > 0,
c->gl_visual->AlphaBits > 0 );
if (!c->gl_buffer) {
- gl_destroy_visual( c->gl_visual );
- gl_destroy_context( c->gl_ctx );
+ _mesa_destroy_visual( c->gl_visual );
+ _mesa_destroy_context( c->gl_ctx );
free(c);
return NULL;
}
WC = c;
if(c->hPalHalfTone != NULL)
DeleteObject(c->hPalHalfTone);
- gl_destroy_visual( c->gl_visual );
- gl_destroy_framebuffer( c->gl_buffer );
- gl_destroy_context( c->gl_ctx );
+ _mesa_destroy_visual( c->gl_visual );
+ _mesa_destroy_framebuffer( c->gl_buffer );
+ _mesa_destroy_context( c->gl_ctx );
if (c->db_flag)
#ifdef DDRAW
return;
//gl_set_context( c->gl_ctx );
- gl_make_current(c->gl_ctx, c->gl_buffer);
+ _mesa_make_current(c->gl_ctx, c->gl_buffer);
setup_DD_pointers(c->gl_ctx);
Current = c;
if (Current->gl_ctx->Viewport.Width==0) {
\r
\r
\r
- c->gl_visual = gl_create_visual(rgb_flag,\r
- GL_FALSE, /* software alpha */\r
- db_flag, /* db_flag */\r
- 16, /* depth_bits */\r
- 8, /* stencil_bits */\r
- 8, /* accum_bits */\r
- 8,\r
- 255.0, 255.0, 255.0, 255.0 );\r
+ c->gl_visual = _mesa_create_visual(rgb_flag,\r
+ db_flag, /* db_flag */\r
+ GL_TRUE, /* stereo */\r
+ 8, 8, 8, 8,/* rgba bits */\r
+ 0, /* index bits */\r
+ 16, /* depth_bits */\r
+ 8, /* stencil_bits */\r
+ 16,16,16,16,/* accum_bits */\r
+ 1 );\r
\r
if (!c->gl_visual) {\r
return NULL;\r
}\r
\r
/* allocate a new Mesa context */\r
- c->gl_ctx = gl_create_context( c->gl_visual, NULL,c);\r
+ c->gl_ctx = _mesa_create_context( c->gl_visual, NULL,c);\r
\r
if (!c->gl_ctx) {\r
- gl_destroy_visual( c->gl_visual );\r
+ _mesa_destroy_visual( c->gl_visual );\r
free(c);\r
return NULL;\r
}\r
\r
- c->gl_buffer = gl_create_framebuffer( c->gl_visual );\r
+ c->gl_buffer = _mesa_create_framebuffer( c->gl_visual );\r
if (!c->gl_buffer) {\r
- gl_destroy_visual( c->gl_visual );\r
- gl_destroy_context( c->gl_ctx );\r
+ _mesa_destroy_visual( c->gl_visual );\r
+ _mesa_destroy_context( c->gl_ctx );\r
free(c);\r
return NULL;\r
}\r
ReleaseDC(c->Window,c->hDC);\r
WC = c;\r
\r
- gl_destroy_visual( c->gl_visual );\r
- gl_destroy_framebuffer( c->gl_buffer );\r
- gl_destroy_context( c->gl_ctx );\r
+ _mesa_destroy_visual( c->gl_visual );\r
+ _mesa_destroy_framebuffer( c->gl_buffer );\r
+ _mesa_destroy_context( c->gl_ctx );\r
\r
if (c->db_flag){\r
wmDeleteBackingStore(c);\r
return;\r
\r
//gl_set_context( c->gl_ctx );\r
- gl_make_current(c->gl_ctx, c->gl_buffer);\r
+ _mesa_make_current(c->gl_ctx, c->gl_buffer);\r
Current = c;\r
setup_DD_pointers(c->gl_ctx);\r
if (Current->gl_ctx->Viewport.Width==0) {\r
-/* $Id: xm_api.c,v 1.1 2000/09/07 15:40:30 brianp Exp $ */
+/* $Id: xm_api.c,v 1.2 2000/09/26 20:54:13 brianp Exp $ */
/*
* Mesa 3-D graphics library
return NULL;
}
- c->gl_ctx = gl_create_context( v->gl_visual,
+ c->gl_ctx = _mesa_create_context( v->gl_visual,
share_list ? share_list->gl_ctx : (GLcontext *) NULL,
(void *) c, direct );
if (!c->gl_ctx) {
#endif
/* Run the config file */
- gl_context_initialize( c->gl_ctx );
+ _mesa_context_initialize( c->gl_ctx );
return c;
}
fxMesaDestroyContext(c->xm_buffer->FXctx);
#endif
if (c->gl_ctx)
- gl_destroy_context( c->gl_ctx );
+ _mesa_destroy_context( c->gl_ctx );
/* Disassociate old buffer with this context */
if (c->xm_buffer)
b->db_state = 0;
}
- b->gl_buffer = gl_create_framebuffer( v->gl_visual,
- v->gl_visual->DepthBits > 0,
- v->gl_visual->StencilBits > 0,
- v->gl_visual->AccumRedBits > 0,
- v->gl_visual->AlphaBits > 0 );
+ b->gl_buffer = _mesa_create_framebuffer( v->gl_visual,
+ v->gl_visual->DepthBits > 0,
+ v->gl_visual->StencilBits > 0,
+ v->gl_visual->AccumRedBits > 0,
+ v->gl_visual->AlphaBits > 0 );
if (!b->gl_buffer) {
free_xmesa_buffer(client, b);
return NULL;
if (!initialize_visual_and_buffer( client, v, b, v->gl_visual->RGBAflag,
(XMesaDrawable)w, b->cmap )) {
- gl_destroy_framebuffer( b->gl_buffer );
+ _mesa_destroy_framebuffer( b->gl_buffer );
free_xmesa_buffer(client, b);
return NULL;
}
b->db_state = 0;
}
- b->gl_buffer = gl_create_framebuffer( v->gl_visual,
- v->gl_visual->DepthBits > 0,
- v->gl_visual->StencilBits > 0,
- v->gl_visual->AccumRedBits +
- v->gl_visual->AccumGreenBits +
- v->gl_visual->AccumBlueBits > 0,
- v->gl_visual->AlphaBits > 0 );
+ b->gl_buffer = _mesa_create_framebuffer( v->gl_visual,
+ v->gl_visual->DepthBits > 0,
+ v->gl_visual->StencilBits > 0,
+ v->gl_visual->AccumRedBits +
+ v->gl_visual->AccumGreenBits +
+ v->gl_visual->AccumBlueBits > 0,
+ v->gl_visual->AlphaBits > 0 );
if (!b->gl_buffer) {
free_xmesa_buffer(client, b);
return NULL;
if (!initialize_visual_and_buffer(client, v, b, v->gl_visual->RGBAflag,
(XMesaDrawable)p, cmap)) {
- gl_destroy_framebuffer( b->gl_buffer );
+ _mesa_destroy_framebuffer( b->gl_buffer );
free_xmesa_buffer(client, b);
return NULL;
}
if (b->xm_context)
b->xm_context->xm_buffer = NULL;
- gl_destroy_framebuffer( b->gl_buffer );
+ _mesa_destroy_framebuffer( b->gl_buffer );
free_xmesa_buffer(client, b);
}
return GL_TRUE;
}
#endif
- if (c->gl_ctx == gl_get_current_context()
+ if (c->gl_ctx == _mesa_get_current_context()
&& c->xm_buffer == drawBuffer
&& c->xm_read_buffer == readBuffer
&& c->xm_buffer->wasCurrent) {
c->xm_read_buffer = readBuffer;
c->use_read_buffer = (drawBuffer != readBuffer);
- gl_make_current2(c->gl_ctx, drawBuffer->gl_buffer, readBuffer->gl_buffer);
+ _mesa_make_current2(c->gl_ctx, drawBuffer->gl_buffer, readBuffer->gl_buffer);
if (c->gl_ctx->Viewport.Width == 0) {
/* initialize viewport to window size */
}
else {
/* Detach */
- gl_make_current2( NULL, NULL, NULL );
+ _mesa_make_current2( NULL, NULL, NULL );
}
return GL_TRUE;
}
GLboolean XMesaForceCurrent(XMesaContext c)
{
if (c) {
- if (c->gl_ctx != gl_get_current_context()) {
- gl_make_current(c->gl_ctx, c->xm_buffer->gl_buffer);
+ if (c->gl_ctx != _mesa_get_current_context()) {
+ _mesa_make_current(c->gl_ctx, c->xm_buffer->gl_buffer);
}
}
else {
- gl_make_current(NULL, NULL);
+ _mesa_make_current(NULL, NULL);
}
return GL_TRUE;
}
GLboolean XMesaLoseCurrent(XMesaContext c)
{
(void) c;
- gl_make_current(NULL, NULL);
+ _mesa_make_current(NULL, NULL);
return GL_TRUE;
}
-/* $Id: xm_line.c,v 1.2 2000/09/12 17:03:59 brianp Exp $ */
+/* $Id: xm_line.c,v 1.3 2000/09/26 20:54:13 brianp Exp $ */
/*
* Mesa 3-D graphics library
&& ctx->RasterMask==DEPTH_BIT
&& ctx->Depth.Func==GL_LESS
&& ctx->Depth.Mask==GL_TRUE
- && ctx->Visual->DepthBits == DEFAULT_SOFTWARE_DEPTH_BITS
+ && ctx->Visual.DepthBits == DEFAULT_SOFTWARE_DEPTH_BITS
&& ctx->Line.Width==1.0F) {
switch (xmesa->pixelformat) {
case PF_TRUECOLOR:
-/* $Id: xm_tri.c,v 1.2 2000/09/12 17:03:59 brianp Exp $ */
+/* $Id: xm_tri.c,v 1.3 2000/09/26 20:54:13 brianp Exp $ */
/*
* Mesa 3-D graphics library
&& ctx->RasterMask==DEPTH_BIT
&& ctx->Depth.Func==GL_LESS
&& ctx->Depth.Mask==GL_TRUE
- && ctx->Visual->DepthBits == DEFAULT_SOFTWARE_DEPTH_BITS
+ && ctx->Visual.DepthBits == DEFAULT_SOFTWARE_DEPTH_BITS
&& ctx->Polygon.StippleFlag==GL_FALSE) {
switch (xmesa->pixelformat) {
case PF_TRUECOLOR:
&& ctx->RasterMask==DEPTH_BIT
&& ctx->Depth.Func==GL_LESS
&& ctx->Depth.Mask==GL_TRUE
- && ctx->Visual->DepthBits == DEFAULT_SOFTWARE_DEPTH_BITS
+ && ctx->Visual.DepthBits == DEFAULT_SOFTWARE_DEPTH_BITS
&& ctx->Polygon.StippleFlag==GL_FALSE) {
switch (xmesa->pixelformat) {
case PF_TRUECOLOR:
-/* $Id: xmesaP.h,v 1.12 2000/09/07 15:42:38 brianp Exp $ */
+/* $Id: xmesaP.h,v 1.13 2000/09/26 20:54:13 brianp Exp $ */
/*
* Mesa 3-D graphics library
/*
- * "Derived" from gl_context. Basically corresponds to a GLXContext.
+ * "Derived" from __GLcontextRec. Basically corresponds to a GLXContext.
*/
struct xmesa_context {
GLcontext *gl_ctx; /* the core library context */
-# $Id: Makefile.X11,v 1.23 2000/09/26 15:27:23 brianp Exp $
+# $Id: Makefile.X11,v 1.24 2000/09/26 20:53:53 brianp Exp $
# Mesa 3-D graphics library
# Version: 3.5
hint.c \
image.c \
imaging.c \
+ imports.c \
light.c \
lines.c \
logic.c \
-/* $Id: accum.c,v 1.25 2000/09/08 21:28:04 brianp Exp $ */
+/* $Id: accum.c,v 1.26 2000/09/26 20:53:53 brianp Exp $ */
/*
* Mesa 3-D graphics library
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glAccum");
- if (ctx->Visual->AccumRedBits == 0 || ctx->DrawBuffer != ctx->ReadBuffer) {
+ if (ctx->Visual.AccumRedBits == 0 || ctx->DrawBuffer != ctx->ReadBuffer) {
gl_error(ctx, GL_INVALID_OPERATION, "glAccum");
return;
}
if (!ctx->DrawBuffer->Accum) {
- gl_warning(ctx, "Calling glAccum() without an accumulation buffer (low memory?)");
+ _mesa_warning(ctx, "Calling glAccum() without an accumulation buffer (low memory?)");
return;
}
GLuint buffersize;
GLfloat acc_scale;
- if (ctx->Visual->AccumRedBits==0) {
+ if (ctx->Visual.AccumRedBits==0) {
/* No accumulation buffer! */
return;
}
-/* $Id: attrib.c,v 1.26 2000/08/21 14:22:24 brianp Exp $ */
+/* $Id: attrib.c,v 1.27 2000/09/26 20:53:53 brianp Exp $ */
/*
* Mesa 3-D graphics library
ctx->Driver.LogicOpcode) {
ctx->Driver.LogicOpcode( ctx, ctx->Color.LogicOp );
}
- if (ctx->Visual->RGBAflag) {
+ if (ctx->Visual.RGBAflag) {
GLubyte r = (GLint) (ctx->Color.ClearColor[0] * 255.0F);
GLubyte g = (GLint) (ctx->Color.ClearColor[1] * 255.0F);
GLubyte b = (GLint) (ctx->Color.ClearColor[2] * 255.0F);
-/* $Id: buffers.c,v 1.11 2000/09/08 21:28:04 brianp Exp $ */
+/* $Id: buffers.c,v 1.12 2000/09/26 20:53:53 brianp Exp $ */
/*
* Mesa 3-D graphics library
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glClearIndex");
ctx->Color.ClearIndex = (GLuint) c;
- if (!ctx->Visual->RGBAflag) {
+ if (!ctx->Visual.RGBAflag) {
/* it's OK to call glClearIndex in RGBA mode but it should be a NOP */
(*ctx->Driver.ClearIndex)( ctx, ctx->Color.ClearIndex );
}
ctx->Color.ClearColor[2] = CLAMP( blue, 0.0F, 1.0F );
ctx->Color.ClearColor[3] = CLAMP( alpha, 0.0F, 1.0F );
- if (ctx->Visual->RGBAflag) {
+ if (ctx->Visual.RGBAflag) {
GLubyte r = (GLint) (ctx->Color.ClearColor[0] * 255.0F);
GLubyte g = (GLint) (ctx->Color.ClearColor[1] * 255.0F);
GLubyte b = (GLint) (ctx->Color.ClearColor[2] * 255.0F);
const GLint height = ctx->DrawBuffer->Ymax - ctx->DrawBuffer->Ymin;
const GLint width = ctx->DrawBuffer->Xmax - ctx->DrawBuffer->Xmin;
- if (ctx->Visual->RGBAflag) {
+ if (ctx->Visual.RGBAflag) {
/* RGBA mode */
const GLubyte r = (GLint) (ctx->Color.ClearColor[0] * 255.0F);
const GLubyte g = (GLint) (ctx->Color.ClearColor[1] * 255.0F);
const GLint width = ctx->DrawBuffer->Xmax - ctx->DrawBuffer->Xmin;
const GLuint colorMask = *((GLuint *) &ctx->Color.ColorMask);
- if (ctx->Visual->RGBAflag) {
+ if (ctx->Visual.RGBAflag) {
/* RGBA mode */
const GLubyte r = (GLint) (ctx->Color.ClearColor[0] * 255.0F);
const GLubyte g = (GLint) (ctx->Color.ClearColor[1] * 255.0F);
else {
/* Color index mode */
ASSERT(ctx->Color.IndexMask == ~0);
- if (ctx->Visual->IndexBits == 8) {
+ if (ctx->Visual.IndexBits == 8) {
/* 8-bit clear */
GLubyte span[MAX_WIDTH];
GLint i;
gl_error( ctx, GL_INVALID_OPERATION, "glDrawBuffer" );
return;
case GL_RIGHT:
- if (!ctx->Visual->StereoFlag) {
+ if (!ctx->Visual.StereoFlag) {
gl_error( ctx, GL_INVALID_OPERATION, "glDrawBuffer" );
- return;
- }
- if (ctx->Visual->DBflag)
+ return;}
+ if (ctx->Visual.DBflag)
ctx->Color.DrawDestMask = FRONT_RIGHT_BIT | BACK_RIGHT_BIT;
else
ctx->Color.DrawDestMask = FRONT_RIGHT_BIT;
break;
case GL_FRONT_RIGHT:
- if (!ctx->Visual->StereoFlag) {
+ if (!ctx->Visual.StereoFlag) {
gl_error( ctx, GL_INVALID_OPERATION, "glDrawBuffer" );
return;
}
ctx->Color.DrawDestMask = FRONT_RIGHT_BIT;
break;
case GL_BACK_RIGHT:
- if (!ctx->Visual->StereoFlag) {
+ if (!ctx->Visual.StereoFlag) {
gl_error( ctx, GL_INVALID_OPERATION, "glDrawBuffer" );
return;
}
- if (!ctx->Visual->DBflag) {
+ if (!ctx->Visual.DBflag) {
gl_error( ctx, GL_INVALID_OPERATION, "glDrawBuffer" );
return;
}
ctx->Color.DrawDestMask = BACK_RIGHT_BIT;
break;
case GL_BACK_LEFT:
- if (!ctx->Visual->DBflag) {
+ if (!ctx->Visual.DBflag) {
gl_error( ctx, GL_INVALID_OPERATION, "glDrawBuffer" );
return;
}
ctx->Color.DrawDestMask = BACK_LEFT_BIT;
break;
case GL_FRONT_AND_BACK:
- if (!ctx->Visual->DBflag) {
+ if (!ctx->Visual.DBflag) {
gl_error( ctx, GL_INVALID_OPERATION, "glDrawBuffer" );
return;
}
- if (ctx->Visual->StereoFlag)
+ if (ctx->Visual.StereoFlag)
ctx->Color.DrawDestMask = FRONT_LEFT_BIT | BACK_LEFT_BIT
| FRONT_RIGHT_BIT | BACK_RIGHT_BIT;
else
ctx->Color.DrawDestMask = FRONT_LEFT_BIT | BACK_LEFT_BIT;
break;
case GL_BACK:
- if (!ctx->Visual->DBflag) {
+ if (!ctx->Visual.DBflag) {
gl_error( ctx, GL_INVALID_OPERATION, "glDrawBuffer" );
return;
}
- if (ctx->Visual->StereoFlag)
+ if (ctx->Visual.StereoFlag)
ctx->Color.DrawDestMask = BACK_LEFT_BIT | BACK_RIGHT_BIT;
else
ctx->Color.DrawDestMask = BACK_LEFT_BIT;
break;
case GL_LEFT:
/* never an error */
- if (ctx->Visual->DBflag)
+ if (ctx->Visual.DBflag)
ctx->Color.DrawDestMask = FRONT_LEFT_BIT | BACK_LEFT_BIT;
else
ctx->Color.DrawDestMask = FRONT_LEFT_BIT;
break;
case GL_FRONT:
/* never an error */
- if (ctx->Visual->StereoFlag)
+ if (ctx->Visual.StereoFlag)
ctx->Color.DrawDestMask = FRONT_LEFT_BIT | FRONT_RIGHT_BIT;
else
ctx->Color.DrawDestMask = FRONT_LEFT_BIT;
/*
* Make the dest buffer mode more precise if possible
*/
- if (mode == GL_LEFT && !ctx->Visual->DBflag)
+ if (mode == GL_LEFT && !ctx->Visual.DBflag)
ctx->Color.DriverDrawBuffer = GL_FRONT_LEFT;
- else if (mode == GL_RIGHT && !ctx->Visual->DBflag)
+ else if (mode == GL_RIGHT && !ctx->Visual.DBflag)
ctx->Color.DriverDrawBuffer = GL_FRONT_RIGHT;
- else if (mode == GL_FRONT && !ctx->Visual->StereoFlag)
+ else if (mode == GL_FRONT && !ctx->Visual.StereoFlag)
ctx->Color.DriverDrawBuffer = GL_FRONT_LEFT;
- else if (mode == GL_BACK && !ctx->Visual->StereoFlag)
+ else if (mode == GL_BACK && !ctx->Visual.StereoFlag)
ctx->Color.DriverDrawBuffer = GL_BACK_LEFT;
else
ctx->Color.DriverDrawBuffer = mode;
case GL_BACK:
case GL_BACK_LEFT:
/* Back-Left buffer, requires double buffering */
- if (!ctx->Visual->DBflag) {
+ if (!ctx->Visual.DBflag) {
gl_error( ctx, GL_INVALID_OPERATION, "glReadBuffer" );
return;
}
break;
case GL_FRONT_RIGHT:
case GL_RIGHT:
- if (!ctx->Visual->StereoFlag) {
+ if (!ctx->Visual.StereoFlag) {
gl_error( ctx, GL_INVALID_OPERATION, "glReadBuffer" );
return;
}
ctx->Pixel.DriverReadBuffer = GL_FRONT_RIGHT;
break;
case GL_BACK_RIGHT:
- if (!ctx->Visual->StereoFlag || !ctx->Visual->DBflag) {
+ if (!ctx->Visual.StereoFlag || !ctx->Visual.DBflag) {
gl_error( ctx, GL_INVALID_OPERATION, "glReadBuffer" );
return;
}
void
_mesa_ResizeBuffersMESA( void )
{
- GLcontext *ctx = gl_get_current_context();
+ GLcontext *ctx = _mesa_get_current_context();
GLuint buf_width, buf_height;
-/* $Id: clip.c,v 1.8 2000/04/17 18:18:00 keithw Exp $ */
+/* $Id: clip.c,v 1.9 2000/09/26 20:53:53 brianp Exp $ */
/*
* Mesa 3-D graphics library
{
GLuint mask = 0;
- if (ctx->Visual->RGBAflag)
+ if (ctx->Visual.RGBAflag)
{
mask |= CLIP_RGBA0;
-/* $Id: config.h,v 1.16 2000/08/21 14:24:53 brianp Exp $ */
+/* $Id: config.h,v 1.17 2000/09/26 20:53:53 brianp Exp $ */
/*
* Mesa 3-D graphics library
/*
* Bits per depth buffer value: 16 or 32 (GLushort or GLuint)
- * gl_create_visual() can select any depth in [0, 32].
+ * _mesa_create_visual() can specify any depth in [0, 32].
*/
#define DEFAULT_SOFTWARE_DEPTH_BITS 16
#define DEFAULT_SOFTWARE_DEPTH_TYPE GLushort
#define VB_SIZE (VB_MAX + VB_MAX_CLIPPED_VERTS)
-
-typedef struct gl_context GLcontext;
+typedef struct __GLcontextRec GLcontext;
extern void
-gl_read_config_file( struct gl_context *ctx );
+gl_read_config_file(GLcontext *ctx);
extern void
gl_register_config_var(const char *name, void (*notify)( const char *, int ));
+
#endif
-/* $Id: context.c,v 1.89 2000/09/26 15:27:22 brianp Exp $ */
+/* $Id: context.c,v 1.90 2000/09/26 20:53:53 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "all.h"
#else
#include "glheader.h"
-#include "accum.h"
-#include "alphabuf.h"
+#include "buffers.h"
#include "clip.h"
#include "colortab.h"
#include "context.h"
#include "cva.h"
-#include "depth.h"
#include "dlist.h"
#include "eval.h"
#include "enums.h"
#include "extensions.h"
#include "fog.h"
#include "get.h"
-#include "glapi.h"
#include "glapinoop.h"
#include "glthread.h"
#include "hash.h"
+#include "imports.h"
#include "light.h"
#include "macros.h"
#include "matrix.h"
#include "pipeline.h"
#include "shade.h"
#include "simple_list.h"
-#include "stencil.h"
#include "stages.h"
#include "state.h"
#include "translate.h"
#include "teximage.h"
#include "texobj.h"
-#include "texstate.h"
#include "texture.h"
#include "types.h"
#include "varray.h"
#include "vb.h"
-#include "vbcull.h"
#include "vbrender.h"
#include "vbxform.h"
#include "vertices.h"
#include "xform.h"
#endif
-
#if defined(MESA_TRACE)
#include "Trace/tr_context.h"
#include "Trace/tr_wrapper.h"
#endif
+
+/**********************************************************************/
+/***** OpenGL SI-style interface (new in Mesa 3.5) *****/
+/**********************************************************************/
+
+static GLboolean
+_mesa_DestroyContext(__GLcontext *gc)
+{
+ if (gc) {
+ _mesa_free_context_data(gc);
+ (*gc->imports.free)(gc, gc);
+ }
+ return GL_TRUE;
+}
+
+
+/* exported OpenGL SI interface */
+__GLcontext *
+__glCoreCreateContext(__GLimports *imports, __GLcontextModes *modes)
+{
+ GLcontext *ctx;
+
+ ctx = (GLcontext *) (*imports->calloc)(0, 1, sizeof(GLcontext));
+ if (ctx == NULL) {
+ return NULL;
+ }
+ ctx->imports = *imports;
+
+ _mesa_initialize_visual(&ctx->Visual,
+ modes->rgbMode,
+ modes->doubleBufferMode,
+ modes->stereoMode,
+ modes->redBits,
+ modes->greenBits,
+ modes->blueBits,
+ modes->alphaBits,
+ modes->indexBits,
+ modes->depthBits,
+ modes->stencilBits,
+ modes->accumRedBits,
+ modes->accumGreenBits,
+ modes->accumBlueBits,
+ modes->accumAlphaBits,
+ 0);
+
+ _mesa_initialize_context(ctx, &ctx->Visual, NULL, imports->wscx, GL_FALSE);
+
+ ctx->exports.destroyContext = _mesa_DestroyContext;
+
+ return ctx;
+}
+
+
+/* exported OpenGL SI interface */
+void
+__glCoreNopDispatch(void)
+{
+#if 0
+ /* SI */
+ __gl_dispatch = __glNopDispatchState;
+#else
+ /* Mesa */
+ _glapi_set_dispatch(NULL);
+#endif
+}
+
+
/**********************************************************************/
/***** Context and Thread management *****/
/**********************************************************************/
indexBits, depthBits, stencilBits,
accumRedBits, accumGreenBits,
accumBlueBits, accumAlphaBits,
- numSamples )) {
+ numSamples)) {
FREE(vis);
return NULL;
}
}
-/* This function should no longer be used. Use _mesa_create_visual() instead */
-GLvisual *
-gl_create_visual( GLboolean rgbFlag,
- GLboolean alphaFlag,
- GLboolean dbFlag,
- GLboolean stereoFlag,
- GLint depthBits,
- GLint stencilBits,
- GLint accumBits,
- GLint indexBits,
- GLint redBits,
- GLint greenBits,
- GLint blueBits,
- GLint alphaBits )
-{
- (void) alphaFlag;
- return _mesa_create_visual(rgbFlag, dbFlag, stereoFlag,
- redBits, greenBits, blueBits, alphaBits,
- indexBits, depthBits, stencilBits,
- accumBits, accumBits, accumBits, accumBits, 0);
-}
-
-
void
_mesa_destroy_visual( GLvisual *vis )
{
}
-/* obsolete */
-void
-gl_destroy_visual( GLvisual *vis )
-{
- _mesa_destroy_visual(vis);
-}
-
-
-
/**********************************************************************/
/***** GL Framebuffer allocation/destruction *****/
/**********************************************************************/
* Return: pointer to new GLframebuffer struct or NULL if error.
*/
GLframebuffer *
-gl_create_framebuffer( GLvisual *visual,
- GLboolean softwareDepth,
- GLboolean softwareStencil,
- GLboolean softwareAccum,
- GLboolean softwareAlpha )
+_mesa_create_framebuffer( GLvisual *visual,
+ GLboolean softwareDepth,
+ GLboolean softwareStencil,
+ GLboolean softwareAccum,
+ GLboolean softwareAlpha )
{
GLframebuffer *buffer = CALLOC_STRUCT(gl_frame_buffer);
assert(visual);
/*
* Initialize a GLframebuffer object.
- * Input: See gl_create_framebuffer() above.
+ * Input: See _mesa_create_framebuffer() above.
*/
void
_mesa_initialize_framebuffer( GLframebuffer *buffer,
* Free a framebuffer struct and its buffers.
*/
void
-gl_destroy_framebuffer( GLframebuffer *buffer )
+_mesa_destroy_framebuffer( GLframebuffer *buffer )
{
if (buffer) {
if (buffer->DepthBuffer) {
ctx->MinMax.Min[BCOMP] = 1000; ctx->MinMax.Max[BCOMP] = -1000;
ctx->MinMax.Min[ACOMP] = 1000; ctx->MinMax.Max[ACOMP] = -1000;
-
-
/* Pipeline */
gl_pipeline_init( ctx );
gl_cva_init( ctx );
#define Sz 10
#define Tz 14
- ctx->Viewport.WindowMap.m[Sz] = 0.5 * ctx->Visual->DepthMaxF;
- ctx->Viewport.WindowMap.m[Tz] = 0.5 * ctx->Visual->DepthMaxF;
+ ctx->Viewport.WindowMap.m[Sz] = 0.5 * ctx->Visual.DepthMaxF;
+ ctx->Viewport.WindowMap.m[Tz] = 0.5 * ctx->Visual.DepthMaxF;
#undef Sz
#undef Tz
}
-
/*
* Initialize a GLcontext struct. This includes allocating all the
* other structs and arrays which hang off of the context by pointers.
/* misc one-time initializations */
one_time_init();
+ /**
+ ** OpenGL SI stuff
+ **/
+ if (!ctx->imports.malloc) {
+ _mesa_InitDefaultImports(&ctx->imports, driver_ctx, NULL);
+ }
+ /* exports are setup by the device driver */
+
ctx->DriverCtx = driver_ctx;
- ctx->Visual = visual;
+ ctx->Visual = *visual;
ctx->DrawBuffer = NULL;
ctx->ReadBuffer = NULL;
* Input: visual - a GLvisual pointer
* sharelist - another context to share display lists with or NULL
* driver_ctx - pointer to device driver's context state struct
- * Return: pointer to a new gl_context struct or NULL if error.
+ * Return: pointer to a new __GLcontextRec or NULL if error.
*/
GLcontext *
-gl_create_context( GLvisual *visual,
- GLcontext *share_list,
- void *driver_ctx,
- GLboolean direct )
+_mesa_create_context( GLvisual *visual,
+ GLcontext *share_list,
+ void *driver_ctx,
+ GLboolean direct )
{
GLcontext *ctx = (GLcontext *) CALLOC( sizeof(GLcontext) );
if (!ctx) {
* But don't free() the GLcontext struct itself!
*/
void
-gl_free_context_data( GLcontext *ctx )
+_mesa_free_context_data( GLcontext *ctx )
{
struct gl_shine_tab *s, *tmps;
GLuint i, j;
/* if we're destroying the current context, unbind it first */
- if (ctx == gl_get_current_context()) {
- gl_make_current(NULL, NULL);
+ if (ctx == _mesa_get_current_context()) {
+ _mesa_make_current(NULL, NULL);
}
gl_matrix_dtr( &ctx->ModelView );
* Destroy a GLcontext structure.
*/
void
-gl_destroy_context( GLcontext *ctx )
+_mesa_destroy_context( GLcontext *ctx )
{
if (ctx) {
- gl_free_context_data(ctx);
+ _mesa_free_context_data(ctx);
FREE( (void *) ctx );
}
}
* initialized. Currently just reads the config file.
*/
void
-gl_context_initialize( GLcontext *ctx )
+_mesa_context_initialize( GLcontext *ctx )
{
gl_read_config_file( ctx );
}
* mask - bitwise OR of GL_*_BIT flags
*/
void
-gl_copy_context( const GLcontext *src, GLcontext *dst, GLuint mask )
+_mesa_copy_context( const GLcontext *src, GLcontext *dst, GLuint mask )
{
if (mask & GL_ACCUM_BUFFER_BIT) {
MEMCPY( &dst->Accum, &src->Accum, sizeof(struct gl_accum_attrib) );
/*
* Set the current context, binding the given frame buffer to the context.
*/
-void gl_make_current( GLcontext *newCtx, GLframebuffer *buffer )
+void
+_mesa_make_current( GLcontext *newCtx, GLframebuffer *buffer )
{
- gl_make_current2( newCtx, buffer, buffer );
+ _mesa_make_current2( newCtx, buffer, buffer );
}
* Bind the given context to the given draw-buffer and read-buffer
* and make it the current context for this thread.
*/
-void gl_make_current2( GLcontext *newCtx, GLframebuffer *drawBuffer,
- GLframebuffer *readBuffer )
+void
+_mesa_make_current2( GLcontext *newCtx, GLframebuffer *drawBuffer,
+ GLframebuffer *readBuffer )
{
#if 0
GLcontext *oldCtx = gl_get_context();
/* Flush the old context
*/
if (oldCtx) {
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(oldCtx, "gl_make_current");
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(oldCtx, "_mesa_make_current");
/* unbind frame buffers from context */
if (oldCtx->DrawBuffer) {
_glapi_check_multithread();
_glapi_set_context((void *) newCtx);
- ASSERT(gl_get_current_context() == newCtx);
+ ASSERT(_mesa_get_current_context() == newCtx);
if (newCtx) {
SET_IMMEDIATE(newCtx, newCtx->input);
_glapi_set_dispatch(newCtx->CurrentDispatch);
_glapi_set_dispatch(NULL); /* none current */
}
- if (MESA_VERBOSE) fprintf(stderr, "gl_make_current()\n");
+ if (MESA_VERBOSE) fprintf(stderr, "_mesa_make_current()\n");
if (newCtx && drawBuffer && readBuffer) {
/* TODO: check if newCtx and buffer's visual match??? */
* This isn't the fastest way to get the current context.
* If you need speed, see the GET_CURRENT_CONTEXT() macro in context.h
*/
-GLcontext *gl_get_current_context( void )
+GLcontext *
+_mesa_get_current_context( void )
{
return (GLcontext *) _glapi_get_context();
}
* something illogical or if there's likely a bug in their program
* (like enabled depth testing without a depth buffer).
*/
-void gl_warning( const GLcontext *ctx, const char *s )
+void
+_mesa_warning( const GLcontext *ctx, const char *s )
{
- GLboolean debug;
-#ifdef DEBUG
- debug = GL_TRUE;
-#else
- if (getenv("MESA_DEBUG")) {
- debug = GL_TRUE;
- }
- else {
- debug = GL_FALSE;
- }
-#endif
- if (debug) {
- fprintf( stderr, "Mesa warning: %s\n", s );
- }
- (void) ctx;
+ (*ctx->imports.warning)((__GLcontext *) ctx, (char *) s);
}
/*
* Compile an error into current display list.
*/
-void gl_compile_error( GLcontext *ctx, GLenum error, const char *s )
+void
+_mesa_compile_error( GLcontext *ctx, GLenum error, const char *s )
{
if (ctx->CompileFlag)
gl_save_error( ctx, error, s );
-/* $Id: context.h,v 1.18 2000/05/24 15:04:45 brianp Exp $ */
+/* $Id: context.h,v 1.19 2000/09/26 20:53:53 brianp Exp $ */
/*
* Mesa 3-D graphics library
GLint accumAlphaBits,
GLint numSamples );
-/* this function is obsolete */
-extern GLvisual *
-gl_create_visual( GLboolean rgbFlag,
- GLboolean alphaFlag,
- GLboolean dbFlag,
- GLboolean stereoFlag,
- GLint depthBits,
- GLint stencilBits,
- GLint accumBits,
- GLint indexBits,
- GLint redBits,
- GLint greenBits,
- GLint blueBits,
- GLint alphaBits );
-
-
extern void
_mesa_destroy_visual( GLvisual *vis );
-/*obsolete */ extern void gl_destroy_visual( GLvisual *vis );
-
/*
* single entity.
*/
extern GLframebuffer *
-gl_create_framebuffer( GLvisual *visual,
- GLboolean softwareDepth,
- GLboolean softwareStencil,
- GLboolean softwareAccum,
- GLboolean softwareAlpha );
+_mesa_create_framebuffer( GLvisual *visual,
+ GLboolean softwareDepth,
+ GLboolean softwareStencil,
+ GLboolean softwareAccum,
+ GLboolean softwareAlpha );
extern void
_mesa_initialize_framebuffer( GLframebuffer *fb,
GLboolean softwareAlpha );
extern void
-gl_destroy_framebuffer( GLframebuffer *buffer );
+_mesa_destroy_framebuffer( GLframebuffer *buffer );
* contains the rendering state.
*/
extern GLcontext *
-gl_create_context( GLvisual *visual,
- GLcontext *share_list,
- void *driver_ctx,
- GLboolean direct);
+_mesa_create_context( GLvisual *visual,
+ GLcontext *share_list,
+ void *driver_ctx,
+ GLboolean direct);
extern GLboolean
_mesa_initialize_context( GLcontext *ctx,
GLboolean direct );
extern void
-gl_free_context_data( GLcontext *ctx );
+_mesa_free_context_data( GLcontext *ctx );
extern void
-gl_destroy_context( GLcontext *ctx );
+_mesa_destroy_context( GLcontext *ctx );
extern void
-gl_context_initialize( GLcontext *ctx );
+_mesa_context_initialize( GLcontext *ctx );
extern void
-gl_copy_context(const GLcontext *src, GLcontext *dst, GLuint mask);
+_mesa_copy_context(const GLcontext *src, GLcontext *dst, GLuint mask);
extern void
-gl_make_current( GLcontext *ctx, GLframebuffer *buffer );
+_mesa_make_current( GLcontext *ctx, GLframebuffer *buffer );
extern void
-gl_make_current2( GLcontext *ctx, GLframebuffer *drawBuffer,
+_mesa_make_current2( GLcontext *ctx, GLframebuffer *drawBuffer,
GLframebuffer *readBuffer );
extern GLcontext *
-gl_get_current_context(void);
+_mesa_get_current_context(void);
gl_problem( const GLcontext *ctx, const char *s );
extern void
-gl_warning( const GLcontext *ctx, const char *s );
+_mesa_warning( const GLcontext *ctx, const char *s );
extern void
gl_error( GLcontext *ctx, GLenum error, const char *s );
extern void
-gl_compile_error( GLcontext *ctx, GLenum error, const char *s );
+_mesa_compile_error( GLcontext *ctx, GLenum error, const char *s );
-/* $Id: depth.c,v 1.18 2000/09/08 21:28:04 brianp Exp $ */
+/* $Id: depth.c,v 1.19 2000/09/26 20:53:53 brianp Exp $ */
/*
* Mesa 3-D graphics library
GLvoid *
_mesa_zbuffer_address(GLcontext *ctx, GLint x, GLint y)
{
- if (ctx->Visual->DepthBits <= 16)
+ if (ctx->Visual.DepthBits <= 16)
return (GLushort *) ctx->DrawBuffer->DepthBuffer + ctx->DrawBuffer->Width * y + x;
else
return (GLuint *) ctx->DrawBuffer->DepthBuffer + ctx->DrawBuffer->Width * y + x;
}
else {
/* software depth buffer */
- if (ctx->Visual->DepthBits <= 16) {
+ if (ctx->Visual.DepthBits <= 16) {
GLushort *zptr = (GLushort *) Z_ADDRESS16(ctx, x, y);
GLuint passed = depth_test_span16(ctx, n, x, y, zptr, z, mask);
return passed;
}
else {
/* software depth testing */
- if (ctx->Visual->DepthBits <= 16)
+ if (ctx->Visual.DepthBits <= 16)
software_depth_test_pixels16(ctx, n, x, y, z, mask);
else
software_depth_test_pixels32(ctx, n, x, y, z, mask);
if (ctx->DrawBuffer->DepthBuffer) {
/* read from software depth buffer */
- if (ctx->Visual->DepthBits <= 16) {
+ if (ctx->Visual.DepthBits <= 16) {
const GLushort *zptr = Z_ADDRESS16( ctx, x, y );
GLuint i;
for (i = 0; i < n; i++) {
_mesa_read_depth_span_float( GLcontext *ctx,
GLint n, GLint x, GLint y, GLfloat depth[] )
{
- const GLfloat scale = 1.0F / ctx->Visual->DepthMaxF;
+ const GLfloat scale = 1.0F / ctx->Visual.DepthMaxF;
if (y < 0 || y >= ctx->DrawBuffer->Height ||
x + (GLint) n <= 0 || x >= ctx->DrawBuffer->Width) {
if (ctx->DrawBuffer->DepthBuffer) {
/* read from software depth buffer */
- if (ctx->Visual->DepthBits <= 16) {
+ if (ctx->Visual.DepthBits <= 16) {
const GLushort *zptr = Z_ADDRESS16( ctx, x, y );
GLuint i;
for (i = 0; i < n; i++) {
}
/* allocate new depth buffer, but don't initialize it */
- if (ctx->Visual->DepthBits <= 16)
+ if (ctx->Visual.DepthBits <= 16)
bytesPerValue = sizeof(GLushort);
else
bytesPerValue = sizeof(GLuint);
void
_mesa_clear_depth_buffer( GLcontext *ctx )
{
- if (ctx->Visual->DepthBits == 0
+ if (ctx->Visual.DepthBits == 0
|| !ctx->DrawBuffer->DepthBuffer
|| !ctx->Depth.Mask) {
/* no depth buffer, or writing to it is disabled */
if (ctx->Scissor.Enabled) {
/* only clear scissor region */
- if (ctx->Visual->DepthBits <= 16) {
- const GLushort clearValue = (GLushort) (ctx->Depth.Clear * ctx->Visual->DepthMax);
+ if (ctx->Visual.DepthBits <= 16) {
+ const GLushort clearValue = (GLushort) (ctx->Depth.Clear * ctx->Visual.DepthMax);
const GLint rows = ctx->DrawBuffer->Ymax - ctx->DrawBuffer->Ymin;
const GLint width = ctx->DrawBuffer->Width;
GLushort *dRow = (GLushort *) ctx->DrawBuffer->DepthBuffer
}
}
else {
- const GLuint clearValue = (GLuint) (ctx->Depth.Clear * ctx->Visual->DepthMax);
+ const GLuint clearValue = (GLuint) (ctx->Depth.Clear * ctx->Visual.DepthMax);
const GLint rows = ctx->DrawBuffer->Ymax - ctx->DrawBuffer->Ymin;
const GLint width = ctx->DrawBuffer->Width;
GLuint *dRow = (GLuint *) ctx->DrawBuffer->DepthBuffer
}
else {
/* clear whole buffer */
- if (ctx->Visual->DepthBits <= 16) {
- const GLushort clearValue = (GLushort) (ctx->Depth.Clear * ctx->Visual->DepthMax);
+ if (ctx->Visual.DepthBits <= 16) {
+ const GLushort clearValue = (GLushort) (ctx->Depth.Clear * ctx->Visual.DepthMax);
if ((clearValue & 0xff) == (clearValue >> 8)) {
if (clearValue == 0) {
BZERO(ctx->DrawBuffer->DepthBuffer,
}
else {
/* >16 bit depth buffer */
- const GLuint clearValue = (GLuint) (ctx->Depth.Clear * ctx->Visual->DepthMax);
+ const GLuint clearValue = (GLuint) (ctx->Depth.Clear * ctx->Visual.DepthMax);
if (clearValue == 0) {
BZERO(ctx->DrawBuffer->DepthBuffer,
ctx->DrawBuffer->Width*ctx->DrawBuffer->Height*sizeof(GLuint));
-/* $Id: dlist.c,v 1.45 2000/08/23 14:33:04 brianp Exp $ */
+/* $Id: dlist.c,v 1.46 2000/09/26 20:53:53 brianp Exp $ */
/*
* Mesa 3-D graphics library
static void save_PolygonOffsetEXT( GLfloat factor, GLfloat bias )
{
GET_CURRENT_CONTEXT(ctx);
- save_PolygonOffset(factor, ctx->Visual->DepthMaxF * bias);
+ save_PolygonOffset(factor, ctx->Visual.DepthMaxF * bias);
}
-/* $Id: drawpix.c,v 1.34 2000/09/12 21:09:24 brianp Exp $ */
+/* $Id: drawpix.c,v 1.35 2000/09/26 20:53:53 brianp Exp $ */
/*
* Mesa 3-D graphics library
}
else {
/* setup array of fragment Z value to pass to zoom function */
- GLdepth z = (GLdepth) (ctx->Current.RasterPos[2] * ctx->Visual->DepthMaxF);
+ GLdepth z = (GLdepth) (ctx->Current.RasterPos[2] * ctx->Visual.DepthMaxF);
GLint i;
ASSERT(drawWidth < MAX_WIDTH);
for (i=0; i<drawWidth; i++)
*/
if (format==GL_RGBA && type==GL_UNSIGNED_BYTE) {
- if (ctx->Visual->RGBAflag) {
+ if (ctx->Visual.RGBAflag) {
GLubyte *src = (GLubyte *) pixels
+ (skipRows * rowLength + skipPixels) * 4;
if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==1.0F) {
return GL_TRUE;
}
else if (format==GL_RGB && type==GL_UNSIGNED_BYTE) {
- if (ctx->Visual->RGBAflag) {
+ if (ctx->Visual.RGBAflag) {
GLubyte *src = (GLubyte *) pixels
+ (skipRows * rowLength + skipPixels) * 3;
if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==1.0F) {
return GL_TRUE;
}
else if (format==GL_LUMINANCE && type==GL_UNSIGNED_BYTE) {
- if (ctx->Visual->RGBAflag) {
+ if (ctx->Visual.RGBAflag) {
GLubyte *src = (GLubyte *) pixels
+ (skipRows * rowLength + skipPixels);
if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==1.0F) {
return GL_TRUE;
}
else if (format==GL_LUMINANCE_ALPHA && type==GL_UNSIGNED_BYTE) {
- if (ctx->Visual->RGBAflag) {
+ if (ctx->Visual.RGBAflag) {
GLubyte *src = (GLubyte *) pixels
+ (skipRows * rowLength + skipPixels)*2;
if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==1.0F) {
}
else if (format==GL_COLOR_INDEX && type==GL_UNSIGNED_BYTE) {
GLubyte *src = (GLubyte *) pixels + skipRows * rowLength + skipPixels;
- if (ctx->Visual->RGBAflag) {
+ if (ctx->Visual.RGBAflag) {
/* convert CI data to RGBA */
if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==1.0F) {
/* no zooming */
/* Fragment depth values */
if (ctx->Depth.Test || ctx->Fog.Enabled) {
- GLdepth zval = (GLdepth) (ctx->Current.RasterPos[2] * ctx->Visual->DepthMaxF);
+ GLdepth zval = (GLdepth) (ctx->Current.RasterPos[2] * ctx->Visual.DepthMaxF);
GLint i;
for (i = 0; i < drawWidth; i++) {
zspan[i] = zval;
}
/* Colors or indexes */
- if (ctx->Visual->RGBAflag) {
+ if (ctx->Visual.RGBAflag) {
GLint r = (GLint) (ctx->Current.RasterColor[0] * 255.0F);
GLint g = (GLint) (ctx->Current.RasterColor[1] * 255.0F);
GLint b = (GLint) (ctx->Current.RasterColor[2] * 255.0F);
}
if (type==GL_UNSIGNED_SHORT && sizeof(GLdepth)==sizeof(GLushort)
- && !bias_or_scale && !zoom && ctx->Visual->RGBAflag) {
+ && !bias_or_scale && !zoom && ctx->Visual.RGBAflag) {
/* Special case: directly write 16-bit depth values */
GLint row;
for (row = 0; row < height; row++, y++) {
gl_write_rgba_span( ctx, width, x, y, zspan, rgba, GL_BITMAP );
}
}
- else if (type==GL_UNSIGNED_INT && ctx->Visual->DepthBits == 32
- && !bias_or_scale && !zoom && ctx->Visual->RGBAflag) {
+ else if (type==GL_UNSIGNED_INT && ctx->Visual.DepthBits == 32
+ && !bias_or_scale && !zoom && ctx->Visual.RGBAflag) {
/* Special case: directly write 32-bit depth values */
GLint row;
for (row = 0; row < height; row++, y++) {
pixels, width, height, GL_DEPTH_COMPONENT, type, 0, row, 0);
_mesa_unpack_depth_span( ctx, drawWidth, zspan, type, src,
&ctx->Unpack, ctx->ImageTransferState );
- if (ctx->Visual->RGBAflag) {
+ if (ctx->Visual.RGBAflag) {
if (zoom) {
gl_write_zoomed_rgba_span(ctx, width, x, y, zspan,
(const GLubyte (*)[4])rgba, desty);
/* Fragment depth values */
if (ctx->Depth.Test || ctx->Fog.Enabled) {
/* fill in array of z values */
- GLdepth z = (GLdepth) (ctx->Current.RasterPos[2] * ctx->Visual->DepthMaxF);
+ GLdepth z = (GLdepth) (ctx->Current.RasterPos[2] * ctx->Visual.DepthMaxF);
GLint i;
for (i=0;i<width;i++) {
zspan[i] = z;
draw_depth_pixels( ctx, x, y, width, height, type, pixels );
break;
case GL_COLOR_INDEX:
- if (ctx->Visual->RGBAflag)
+ if (ctx->Visual.RGBAflag)
draw_rgba_pixels(ctx, x,y, width, height, format, type, pixels);
else
draw_index_pixels(ctx, x, y, width, height, type, pixels);
-/* $Id: enable.c,v 1.23 2000/08/30 18:21:06 brianp Exp $ */
+/* $Id: enable.c,v 1.24 2000/09/26 20:53:53 brianp Exp $ */
/*
* Mesa 3-D graphics library
}
break;
case GL_DEPTH_TEST:
- if (state && ctx->Visual->DepthBits==0) {
- gl_warning(ctx,"glEnable(GL_DEPTH_TEST) but no depth buffer");
+ if (state && ctx->Visual.DepthBits==0) {
+ _mesa_warning(ctx,"glEnable(GL_DEPTH_TEST) but no depth buffer");
return;
}
if (ctx->Depth.Test!=state) {
ctx->Texture.SharedPalette = state;
break;
case GL_STENCIL_TEST:
- if (state && ctx->Visual->StencilBits==0) {
- gl_warning(ctx, "glEnable(GL_STENCIL_TEST) but no stencil buffer");
+ if (state && ctx->Visual.StencilBits==0) {
+ _mesa_warning(ctx, "glEnable(GL_STENCIL_TEST) but no stencil buffer");
return;
}
if (ctx->Stencil.Enabled!=state) {
}
break;
case GL_TEXTURE_1D:
- if (ctx->Visual->RGBAflag) {
+ if (ctx->Visual.RGBAflag) {
const GLuint curr = ctx->Texture.CurrentUnit;
const GLuint flag = TEXTURE0_1D << (curr * 4);
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[curr];
}
break;
case GL_TEXTURE_2D:
- if (ctx->Visual->RGBAflag) {
+ if (ctx->Visual.RGBAflag) {
const GLuint curr = ctx->Texture.CurrentUnit;
const GLuint flag = TEXTURE0_2D << (curr * 4);
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[curr];
}
break;
case GL_TEXTURE_3D:
- if (ctx->Visual->RGBAflag) {
+ if (ctx->Visual.RGBAflag) {
const GLuint curr = ctx->Texture.CurrentUnit;
const GLuint flag = TEXTURE0_3D << (curr * 4);
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[curr];
/* GL_ARB_texture_cube_map */
case GL_TEXTURE_CUBE_MAP_ARB:
if (ctx->Extensions.HaveTextureCubeMap) {
- if (ctx->Visual->RGBAflag) {
+ if (ctx->Visual.RGBAflag) {
const GLuint curr = ctx->Texture.CurrentUnit;
const GLuint flag = TEXTURE0_CUBE << (curr * 4);
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[curr];
-/* $Id: feedback.c,v 1.10 2000/05/09 23:54:09 brianp Exp $ */
+/* $Id: feedback.c,v 1.11 2000/09/26 20:53:53 brianp Exp $ */
/*
* Mesa 3-D graphics library
break;
case GL_3D_COLOR:
ctx->Feedback.Mask = FB_3D
- | (ctx->Visual->RGBAflag ? FB_COLOR : FB_INDEX);
+ | (ctx->Visual.RGBAflag ? FB_COLOR : FB_INDEX);
ctx->Feedback.Type = type;
break;
case GL_3D_COLOR_TEXTURE:
ctx->Feedback.Mask = FB_3D
- | (ctx->Visual->RGBAflag ? FB_COLOR : FB_INDEX)
+ | (ctx->Visual.RGBAflag ? FB_COLOR : FB_INDEX)
| FB_TEXTURE;
ctx->Feedback.Type = type;
break;
case GL_4D_COLOR_TEXTURE:
ctx->Feedback.Mask = FB_3D | FB_4D
- | (ctx->Visual->RGBAflag ? FB_COLOR : FB_INDEX)
+ | (ctx->Visual.RGBAflag ? FB_COLOR : FB_INDEX)
| FB_TEXTURE;
ctx->Feedback.Type = type;
break;
win[0] = VB->Win.data[v][0];
win[1] = VB->Win.data[v][1];
- win[2] = VB->Win.data[v][2] / ctx->Visual->DepthMaxF;
+ win[2] = VB->Win.data[v][2] / ctx->Visual.DepthMaxF;
win[3] = 1.0 / VB->Win.data[v][3];
if (ctx->Light.ShadeModel == GL_SMOOTH)
const struct vertex_buffer *VB = ctx->VB;
if (gl_cull_triangle( ctx, v0, v1, v2, 0 )) {
- const GLfloat zs = 1.0F / ctx->Visual->DepthMaxF;
+ const GLfloat zs = 1.0F / ctx->Visual.DepthMaxF;
gl_update_hitflag( ctx, VB->Win.data[v0][2] * zs );
gl_update_hitflag( ctx, VB->Win.data[v1][2] * zs );
gl_update_hitflag( ctx, VB->Win.data[v2][2] * zs );
GLuint v0, GLuint v1, GLuint pv )
{
const struct vertex_buffer *VB = ctx->VB;
- const GLfloat zs = 1.0F / ctx->Visual->DepthMaxF;
+ const GLfloat zs = 1.0F / ctx->Visual.DepthMaxF;
gl_update_hitflag( ctx, VB->Win.data[v0][2] * zs );
gl_update_hitflag( ctx, VB->Win.data[v1][2] * zs );
}
void gl_select_points( GLcontext *ctx, GLuint first, GLuint last )
{
struct vertex_buffer *VB = ctx->VB;
- const GLfloat zs = 1.0F / ctx->Visual->DepthMaxF;
+ const GLfloat zs = 1.0F / ctx->Visual.DepthMaxF;
GLuint i;
for (i=first;i<=last;i++) {
if (ctx->Select.BufferCount > ctx->Select.BufferSize) {
/* overflow */
#ifdef DEBUG
- gl_warning(ctx, "Feedback buffer overflow");
+ _mesa_warning(ctx, "Feedback buffer overflow");
#endif
result = -1;
}
-/* $Id: fog.c,v 1.19 2000/07/07 15:10:35 keithw Exp $ */
+/* $Id: fog.c,v 1.20 2000/09/26 20:53:53 brianp Exp $ */
/*
* Mesa 3-D graphics library
GLcontext *ctx = VB->ctx;
GLuint i = VB->CullMode & 1;
- if (ctx->Visual->RGBAflag) {
+ if (ctx->Visual.RGBAflag) {
/* Fog RGB colors */
if (ctx->TriangleCaps & DD_TRI_LIGHT_TWOSIDE) {
fog_rgba_tab[i]( VB, 0, VERT_FACE_FRONT );
-/* $Id: get.c,v 1.33 2000/09/15 19:57:51 brianp Exp $ */
+/* $Id: get.c,v 1.34 2000/09/26 20:53:53 brianp Exp $ */
/*
* Mesa 3-D graphics library
switch (pname) {
case GL_ACCUM_RED_BITS:
- *params = INT_TO_BOOL(ctx->Visual->AccumRedBits);
+ *params = INT_TO_BOOL(ctx->Visual.AccumRedBits);
break;
case GL_ACCUM_GREEN_BITS:
- *params = INT_TO_BOOL(ctx->Visual->AccumGreenBits);
+ *params = INT_TO_BOOL(ctx->Visual.AccumGreenBits);
break;
case GL_ACCUM_BLUE_BITS:
- *params = INT_TO_BOOL(ctx->Visual->AccumBlueBits);
+ *params = INT_TO_BOOL(ctx->Visual.AccumBlueBits);
break;
case GL_ACCUM_ALPHA_BITS:
- *params = INT_TO_BOOL(ctx->Visual->AccumAlphaBits);
+ *params = INT_TO_BOOL(ctx->Visual.AccumAlphaBits);
break;
case GL_ACCUM_CLEAR_VALUE:
params[0] = FLOAT_TO_BOOL(ctx->Accum.ClearColor[0]);
*params = FLOAT_TO_BOOL(ctx->Pixel.AlphaBias);
break;
case GL_ALPHA_BITS:
- *params = INT_TO_BOOL(ctx->Visual->AlphaBits);
+ *params = INT_TO_BOOL(ctx->Visual.AlphaBits);
break;
case GL_ALPHA_SCALE:
*params = FLOAT_TO_BOOL(ctx->Pixel.AlphaScale);
*params = FLOAT_TO_BOOL(ctx->Pixel.BlueBias);
break;
case GL_BLUE_BITS:
- *params = INT_TO_BOOL( ctx->Visual->BlueBits );
+ *params = INT_TO_BOOL( ctx->Visual.BlueBits );
break;
case GL_BLUE_SCALE:
*params = FLOAT_TO_BOOL(ctx->Pixel.BlueScale);
*params = FLOAT_TO_BOOL(ctx->Pixel.DepthBias);
break;
case GL_DEPTH_BITS:
- *params = INT_TO_BOOL(ctx->Visual->DepthBits);
+ *params = INT_TO_BOOL(ctx->Visual.DepthBits);
break;
case GL_DEPTH_CLEAR_VALUE:
*params = FLOAT_TO_BOOL(ctx->Depth.Clear);
*params = ctx->Color.DitherFlag;
break;
case GL_DOUBLEBUFFER:
- *params = ctx->Visual->DBflag;
+ *params = ctx->Visual.DBflag;
break;
case GL_DRAW_BUFFER:
*params = ENUM_TO_BOOL(ctx->Color.DrawBuffer);
*params = FLOAT_TO_BOOL(ctx->Pixel.GreenBias);
break;
case GL_GREEN_BITS:
- *params = INT_TO_BOOL( ctx->Visual->GreenBits );
+ *params = INT_TO_BOOL( ctx->Visual.GreenBits );
break;
case GL_GREEN_SCALE:
*params = FLOAT_TO_BOOL(ctx->Pixel.GreenScale);
}
break;
case GL_INDEX_BITS:
- *params = INT_TO_BOOL( ctx->Visual->IndexBits );
+ *params = INT_TO_BOOL( ctx->Visual.IndexBits );
break;
case GL_INDEX_CLEAR_VALUE:
*params = INT_TO_BOOL(ctx->Color.ClearIndex);
break;
case GL_INDEX_MODE:
- *params = ctx->Visual->RGBAflag ? GL_FALSE : GL_TRUE;
+ *params = ctx->Visual.RGBAflag ? GL_FALSE : GL_TRUE;
break;
case GL_INDEX_OFFSET:
*params = INT_TO_BOOL(ctx->Pixel.IndexOffset);
*params = FLOAT_TO_BOOL(ctx->Pixel.RedBias);
break;
case GL_RED_BITS:
- *params = INT_TO_BOOL( ctx->Visual->RedBits );
+ *params = INT_TO_BOOL( ctx->Visual.RedBits );
break;
case GL_RED_SCALE:
*params = FLOAT_TO_BOOL(ctx->Pixel.RedScale);
*params = ENUM_TO_BOOL(ctx->RenderMode);
break;
case GL_RGBA_MODE:
- *params = ctx->Visual->RGBAflag;
+ *params = ctx->Visual.RGBAflag;
break;
case GL_SCISSOR_BOX:
params[0] = INT_TO_BOOL(ctx->Scissor.X);
*params = ctx->Texture.SharedPalette;
break;
case GL_STENCIL_BITS:
- *params = INT_TO_BOOL(ctx->Visual->StencilBits);
+ *params = INT_TO_BOOL(ctx->Visual.StencilBits);
break;
case GL_STENCIL_CLEAR_VALUE:
*params = INT_TO_BOOL(ctx->Stencil.Clear);
*params = INT_TO_BOOL(ctx->Stencil.WriteMask);
break;
case GL_STEREO:
- *params = ctx->Visual->StereoFlag;
+ *params = ctx->Visual.StereoFlag;
break;
case GL_SUBPIXEL_BITS:
*params = INT_TO_BOOL(ctx->Const.SubPixelBits);
switch (pname) {
case GL_ACCUM_RED_BITS:
- *params = (GLdouble) ctx->Visual->AccumRedBits;
+ *params = (GLdouble) ctx->Visual.AccumRedBits;
break;
case GL_ACCUM_GREEN_BITS:
- *params = (GLdouble) ctx->Visual->AccumGreenBits;
+ *params = (GLdouble) ctx->Visual.AccumGreenBits;
break;
case GL_ACCUM_BLUE_BITS:
- *params = (GLdouble) ctx->Visual->AccumBlueBits;
+ *params = (GLdouble) ctx->Visual.AccumBlueBits;
break;
case GL_ACCUM_ALPHA_BITS:
- *params = (GLdouble) ctx->Visual->AccumAlphaBits;
+ *params = (GLdouble) ctx->Visual.AccumAlphaBits;
break;
case GL_ACCUM_CLEAR_VALUE:
params[0] = (GLdouble) ctx->Accum.ClearColor[0];
*params = (GLdouble) ctx->Pixel.AlphaBias;
break;
case GL_ALPHA_BITS:
- *params = (GLdouble) ctx->Visual->AlphaBits;
+ *params = (GLdouble) ctx->Visual.AlphaBits;
break;
case GL_ALPHA_SCALE:
*params = (GLdouble) ctx->Pixel.AlphaScale;
*params = (GLdouble) ctx->Pixel.BlueBias;
break;
case GL_BLUE_BITS:
- *params = (GLdouble) ctx->Visual->BlueBits;
+ *params = (GLdouble) ctx->Visual.BlueBits;
break;
case GL_BLUE_SCALE:
*params = (GLdouble) ctx->Pixel.BlueScale;
*params = (GLdouble) ctx->Pixel.DepthBias;
break;
case GL_DEPTH_BITS:
- *params = (GLdouble) ctx->Visual->DepthBits;
+ *params = (GLdouble) ctx->Visual.DepthBits;
break;
case GL_DEPTH_CLEAR_VALUE:
*params = (GLdouble) ctx->Depth.Clear;
*params = (GLdouble) ctx->Color.DitherFlag;
break;
case GL_DOUBLEBUFFER:
- *params = (GLdouble) ctx->Visual->DBflag;
+ *params = (GLdouble) ctx->Visual.DBflag;
break;
case GL_DRAW_BUFFER:
*params = ENUM_TO_DOUBLE(ctx->Color.DrawBuffer);
*params = (GLdouble) ctx->Pixel.GreenBias;
break;
case GL_GREEN_BITS:
- *params = (GLdouble) ctx->Visual->GreenBits;
+ *params = (GLdouble) ctx->Visual.GreenBits;
break;
case GL_GREEN_SCALE:
*params = (GLdouble) ctx->Pixel.GreenScale;
}
break;
case GL_INDEX_BITS:
- *params = (GLdouble) ctx->Visual->IndexBits;
+ *params = (GLdouble) ctx->Visual.IndexBits;
break;
case GL_INDEX_CLEAR_VALUE:
*params = (GLdouble) ctx->Color.ClearIndex;
break;
case GL_INDEX_MODE:
- *params = ctx->Visual->RGBAflag ? 0.0 : 1.0;
+ *params = ctx->Visual.RGBAflag ? 0.0 : 1.0;
break;
case GL_INDEX_OFFSET:
*params = (GLdouble) ctx->Pixel.IndexOffset;
*params = (GLdouble) ctx->Pixel.RedBias;
break;
case GL_RED_BITS:
- *params = (GLdouble) ctx->Visual->RedBits;
+ *params = (GLdouble) ctx->Visual.RedBits;
break;
case GL_RED_SCALE:
*params = (GLdouble) ctx->Pixel.RedScale;
*params = ENUM_TO_DOUBLE(ctx->RenderMode);
break;
case GL_RGBA_MODE:
- *params = (GLdouble) ctx->Visual->RGBAflag;
+ *params = (GLdouble) ctx->Visual.RGBAflag;
break;
case GL_SCISSOR_BOX:
params[0] = (GLdouble) ctx->Scissor.X;
*params = (GLdouble) ctx->Texture.SharedPalette;
break;
case GL_STENCIL_BITS:
- *params = (GLdouble) ctx->Visual->StencilBits;
+ *params = (GLdouble) ctx->Visual.StencilBits;
break;
case GL_STENCIL_CLEAR_VALUE:
*params = (GLdouble) ctx->Stencil.Clear;
*params = (GLdouble) ctx->Stencil.WriteMask;
break;
case GL_STEREO:
- *params = (GLdouble) ctx->Visual->StereoFlag;
+ *params = (GLdouble) ctx->Visual.StereoFlag;
break;
case GL_SUBPIXEL_BITS:
*params = (GLdouble) ctx->Const.SubPixelBits;
switch (pname) {
case GL_ACCUM_RED_BITS:
- *params = (GLfloat) ctx->Visual->AccumRedBits;
+ *params = (GLfloat) ctx->Visual.AccumRedBits;
break;
case GL_ACCUM_GREEN_BITS:
- *params = (GLfloat) ctx->Visual->AccumGreenBits;
+ *params = (GLfloat) ctx->Visual.AccumGreenBits;
break;
case GL_ACCUM_BLUE_BITS:
- *params = (GLfloat) ctx->Visual->AccumBlueBits;
+ *params = (GLfloat) ctx->Visual.AccumBlueBits;
break;
case GL_ACCUM_ALPHA_BITS:
- *params = (GLfloat) ctx->Visual->AccumAlphaBits;
+ *params = (GLfloat) ctx->Visual.AccumAlphaBits;
break;
case GL_ACCUM_CLEAR_VALUE:
params[0] = ctx->Accum.ClearColor[0];
*params = ctx->Pixel.AlphaBias;
break;
case GL_ALPHA_BITS:
- *params = (GLfloat) ctx->Visual->AlphaBits;
+ *params = (GLfloat) ctx->Visual.AlphaBits;
break;
case GL_ALPHA_SCALE:
*params = ctx->Pixel.AlphaScale;
*params = ctx->Pixel.BlueBias;
break;
case GL_BLUE_BITS:
- *params = (GLfloat) ctx->Visual->BlueBits;
+ *params = (GLfloat) ctx->Visual.BlueBits;
break;
case GL_BLUE_SCALE:
*params = ctx->Pixel.BlueScale;
*params = (GLfloat) ctx->Pixel.DepthBias;
break;
case GL_DEPTH_BITS:
- *params = (GLfloat) ctx->Visual->DepthBits;
+ *params = (GLfloat) ctx->Visual.DepthBits;
break;
case GL_DEPTH_CLEAR_VALUE:
*params = (GLfloat) ctx->Depth.Clear;
*params = (GLfloat) ctx->Color.DitherFlag;
break;
case GL_DOUBLEBUFFER:
- *params = (GLfloat) ctx->Visual->DBflag;
+ *params = (GLfloat) ctx->Visual.DBflag;
break;
case GL_DRAW_BUFFER:
*params = ENUM_TO_FLOAT(ctx->Color.DrawBuffer);
*params = (GLfloat) ctx->Pixel.GreenBias;
break;
case GL_GREEN_BITS:
- *params = (GLfloat) ctx->Visual->GreenBits;
+ *params = (GLfloat) ctx->Visual.GreenBits;
break;
case GL_GREEN_SCALE:
*params = (GLfloat) ctx->Pixel.GreenScale;
}
break;
case GL_INDEX_BITS:
- *params = (GLfloat) ctx->Visual->IndexBits;
+ *params = (GLfloat) ctx->Visual.IndexBits;
break;
case GL_INDEX_CLEAR_VALUE:
*params = (GLfloat) ctx->Color.ClearIndex;
break;
case GL_INDEX_MODE:
- *params = ctx->Visual->RGBAflag ? 0.0F : 1.0F;
+ *params = ctx->Visual.RGBAflag ? 0.0F : 1.0F;
break;
case GL_INDEX_OFFSET:
*params = (GLfloat) ctx->Pixel.IndexOffset;
*params = ctx->Pixel.RedBias;
break;
case GL_RED_BITS:
- *params = (GLfloat) ctx->Visual->RedBits;
+ *params = (GLfloat) ctx->Visual.RedBits;
break;
case GL_RED_SCALE:
*params = ctx->Pixel.RedScale;
*params = ENUM_TO_FLOAT(ctx->RenderMode);
break;
case GL_RGBA_MODE:
- *params = (GLfloat) ctx->Visual->RGBAflag;
+ *params = (GLfloat) ctx->Visual.RGBAflag;
break;
case GL_SCISSOR_BOX:
params[0] = (GLfloat) ctx->Scissor.X;
*params = (GLfloat) ctx->Texture.SharedPalette;
break;
case GL_STENCIL_BITS:
- *params = (GLfloat) ctx->Visual->StencilBits;
+ *params = (GLfloat) ctx->Visual.StencilBits;
break;
case GL_STENCIL_CLEAR_VALUE:
*params = (GLfloat) ctx->Stencil.Clear;
*params = (GLfloat) ctx->Stencil.WriteMask;
break;
case GL_STEREO:
- *params = (GLfloat) ctx->Visual->StereoFlag;
+ *params = (GLfloat) ctx->Visual.StereoFlag;
break;
case GL_SUBPIXEL_BITS:
*params = (GLfloat) ctx->Const.SubPixelBits;
switch (pname) {
case GL_ACCUM_RED_BITS:
- *params = (GLint) ctx->Visual->AccumRedBits;
+ *params = (GLint) ctx->Visual.AccumRedBits;
break;
case GL_ACCUM_GREEN_BITS:
- *params = (GLint) ctx->Visual->AccumGreenBits;
+ *params = (GLint) ctx->Visual.AccumGreenBits;
break;
case GL_ACCUM_BLUE_BITS:
- *params = (GLint) ctx->Visual->AccumBlueBits;
+ *params = (GLint) ctx->Visual.AccumBlueBits;
break;
case GL_ACCUM_ALPHA_BITS:
- *params = (GLint) ctx->Visual->AccumAlphaBits;
+ *params = (GLint) ctx->Visual.AccumAlphaBits;
break;
case GL_ACCUM_CLEAR_VALUE:
params[0] = FLOAT_TO_INT( ctx->Accum.ClearColor[0] );
*params = (GLint) ctx->Pixel.AlphaBias;
break;
case GL_ALPHA_BITS:
- *params = ctx->Visual->AlphaBits;
+ *params = ctx->Visual.AlphaBits;
break;
case GL_ALPHA_SCALE:
*params = (GLint) ctx->Pixel.AlphaScale;
*params = (GLint) ctx->Pixel.BlueBias;
break;
case GL_BLUE_BITS:
- *params = (GLint) ctx->Visual->BlueBits;
+ *params = (GLint) ctx->Visual.BlueBits;
break;
case GL_BLUE_SCALE:
*params = (GLint) ctx->Pixel.BlueScale;
*params = (GLint) ctx->Pixel.DepthBias;
break;
case GL_DEPTH_BITS:
- *params = ctx->Visual->DepthBits;
+ *params = ctx->Visual.DepthBits;
break;
case GL_DEPTH_CLEAR_VALUE:
*params = (GLint) ctx->Depth.Clear;
*params = (GLint) ctx->Color.DitherFlag;
break;
case GL_DOUBLEBUFFER:
- *params = (GLint) ctx->Visual->DBflag;
+ *params = (GLint) ctx->Visual.DBflag;
break;
case GL_DRAW_BUFFER:
*params = (GLint) ctx->Color.DrawBuffer;
*params = (GLint) ctx->Pixel.GreenBias;
break;
case GL_GREEN_BITS:
- *params = (GLint) ctx->Visual->GreenBits;
+ *params = (GLint) ctx->Visual.GreenBits;
break;
case GL_GREEN_SCALE:
*params = (GLint) ctx->Pixel.GreenScale;
}
break;
case GL_INDEX_BITS:
- *params = (GLint) ctx->Visual->IndexBits;
+ *params = (GLint) ctx->Visual.IndexBits;
break;
case GL_INDEX_CLEAR_VALUE:
*params = (GLint) ctx->Color.ClearIndex;
break;
case GL_INDEX_MODE:
- *params = ctx->Visual->RGBAflag ? 0 : 1;
+ *params = ctx->Visual.RGBAflag ? 0 : 1;
break;
case GL_INDEX_OFFSET:
*params = ctx->Pixel.IndexOffset;
*params = (GLint) ctx->Pixel.RedBias;
break;
case GL_RED_BITS:
- *params = (GLint) ctx->Visual->RedBits;
+ *params = (GLint) ctx->Visual.RedBits;
break;
case GL_RED_SCALE:
*params = (GLint) ctx->Pixel.RedScale;
*params = (GLint) ctx->RenderMode;
break;
case GL_RGBA_MODE:
- *params = (GLint) ctx->Visual->RGBAflag;
+ *params = (GLint) ctx->Visual.RGBAflag;
break;
case GL_SCISSOR_BOX:
params[0] = (GLint) ctx->Scissor.X;
*params = (GLint) ctx->Texture.SharedPalette;
break;
case GL_STENCIL_BITS:
- *params = ctx->Visual->StencilBits;
+ *params = ctx->Visual.StencilBits;
break;
case GL_STENCIL_CLEAR_VALUE:
*params = (GLint) ctx->Stencil.Clear;
*params = (GLint) ctx->Stencil.WriteMask;
break;
case GL_STEREO:
- *params = (GLint) ctx->Visual->StereoFlag;
+ *params = (GLint) ctx->Visual.StereoFlag;
break;
case GL_SUBPIXEL_BITS:
*params = ctx->Const.SubPixelBits;
-/* $Id: glheader.h,v 1.14 2000/09/15 15:42:45 brianp Exp $ */
+/* $Id: glheader.h,v 1.15 2000/09/26 20:53:53 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "GL/glext.h"
+#ifndef CAPI
+#define CAPI
+#endif
+#include "glcore.h"
+
+
/* Disable unreachable code warnings for Watcom C++ */
#ifdef __WATCOMC__
-/* $Id: image.c,v 1.41 2000/09/14 23:13:51 brianp Exp $ */
+/* $Id: image.c,v 1.42 2000/09/26 20:53:53 brianp Exp $ */
/*
* Mesa 3-D graphics library
srcType == GL_UNSIGNED_INT_2_10_10_10_REV);
/* this is intended for RGBA mode only */
- assert(ctx->Visual->RGBAflag);
+ assert(ctx->Visual.RGBAflag);
/* Try simple cases first */
if (transferOps == 0 && srcType == GL_UNSIGNED_BYTE) {
srcType == GL_UNSIGNED_INT_2_10_10_10_REV);
/* this is intended for RGBA mode only */
- assert(ctx->Visual->RGBAflag);
+ assert(ctx->Visual.RGBAflag);
/* general solution, no special cases, yet */
{
/* clamp depth values to [0,1] and convert from floats to integers */
{
- const GLfloat zs = ctx->Visual->DepthMaxF;
+ const GLfloat zs = ctx->Visual.DepthMaxF;
GLuint i;
for (i = 0; i < n; i++) {
dest[i] = (GLdepth) (CLAMP(depth[i], 0.0F, 1.0F) * zs);
--- /dev/null
+/* $Id: imports.c,v 1.1 2000/09/26 20:53:53 brianp Exp $ */
+
+/*
+ * Mesa 3-D graphics library
+ * Version: 3.5
+ *
+ * Copyright (C) 1999-2000 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"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * 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.
+ */
+
+
+/*
+ * Imports are functions which the device driver or window system or
+ * operating system provides to the core renderer. The core renderer (Mesa)
+ * will call these functions in order to do memory allocation, simple I/O,
+ * etc.
+ *
+ * Some drivers will need to implement these functions themselves but
+ * many (most?) Mesa drivers will be fine using these.
+ *
+ * A server-side GL renderer will likely not use these functions since
+ * the renderer should use the XFree86-wrapped system calls.
+ */
+
+
+#include "glheader.h"
+#include "imports.h"
+#include "mem.h"
+
+
+static void *
+_mesa_Malloc(__GLcontext *gc, size_t size)
+{
+ return MALLOC(size);
+}
+
+static void *
+_mesa_Calloc(__GLcontext *gc, size_t numElem, size_t elemSize)
+{
+ return CALLOC(numElem * elemSize);
+}
+
+static void *
+_mesa_Realloc(__GLcontext *gc, void *oldAddr, size_t newSize)
+{
+ return realloc(oldAddr, newSize);
+}
+
+static void
+_mesa_Free(__GLcontext *gc, void *addr)
+{
+ FREE(addr);
+}
+
+static void
+_mesa_warning(__GLcontext *gc, char *str)
+{
+ GLboolean debug;
+#ifdef DEBUG
+ debug = GL_TRUE;
+#else
+ if (gc->imports.getenv("MESA_DEBUG")) {
+ debug = GL_TRUE;
+ }
+ else {
+ debug = GL_FALSE;
+ }
+#endif
+ if (debug) {
+ fprintf(stderr, "Mesa warning: %s\n", str);
+ }
+}
+
+static void
+_mesa_fatal(__GLcontext *gc, char *str)
+{
+ fprintf(stderr, "%s\n", str);
+ abort();
+}
+
+static char *
+_mesa_getenv(__GLcontext *gc, const char *var)
+{
+ (void) gc;
+ return getenv(var);
+}
+
+static int
+_mesa_atoi(__GLcontext *gc, const char *str)
+{
+ (void) gc;
+ return atoi(str);
+}
+
+static int
+_mesa_sprintf(__GLcontext *gc, char *str, const char *fmt, ...)
+{
+ /* XXX fix this */
+ return sprintf(str, fmt);
+}
+
+static void *
+_mesa_fopen(__GLcontext *gc, const char *path, const char *mode)
+{
+ return fopen(path, mode);
+}
+
+static int
+_mesa_fclose(__GLcontext *gc, void *stream)
+{
+ return fclose(stream);
+}
+
+static int
+_mesa_fprintf(__GLcontext *gc, void *stream, const char *fmt, ...)
+{
+ /* XXX fix this */
+ return fprintf(stream, fmt);
+}
+
+/* XXX this really is driver-specific and can't be here */
+static __GLdrawablePrivate *
+_mesa_GetDrawablePrivate(__GLcontext *gc)
+{
+ return NULL;
+}
+
+
+void
+_mesa_InitDefaultImports(__GLimports *imports, void *driverCtx, void *other)
+{
+ imports->malloc = _mesa_Malloc;
+ imports->calloc = _mesa_Calloc;
+ imports->realloc = _mesa_Realloc;
+ imports->free = _mesa_Free;
+ imports->warning = _mesa_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->wscx = driverCtx;
+ imports->other = other;
+}
--- /dev/null
+/* $Id: imports.h,v 1.1 2000/09/26 20:53:53 brianp Exp $ */
+
+/*
+ * Mesa 3-D graphics library
+ * Version: 3.5
+ *
+ * Copyright (C) 1999-2000 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"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * 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.
+ */
+
+
+#ifndef IMPORTS_H
+#define IMPORTS_H
+
+
+#include "glheader.h"
+
+
+extern void
+_mesa_InitDefaultImports(__GLimports *imports, void *driverCtx, void *other);
+
+
+#endif
-/* $Id: light.c,v 1.16 2000/07/18 16:55:56 brianp Exp $ */
+/* $Id: light.c,v 1.17 2000/09/26 20:53:53 brianp Exp $ */
/*
* Mesa 3-D graphics library
/* Precompute some shading values.
*/
- if (ctx->Visual->RGBAflag) {
+ if (ctx->Visual.RGBAflag) {
GLuint sides = ((ctx->TriangleCaps & DD_TRI_LIGHT_TWOSIDE) ? 2 : 1);
GLuint side;
for (side=0; side < sides; side++) {
-/* $Id: lines.c,v 1.12 2000/07/14 14:04:07 brianp Exp $ */
+/* $Id: lines.c,v 1.13 2000/09/26 20:53:53 brianp Exp $ */
/*
* Mesa 3-D graphics library
*/
void gl_set_line_function( GLcontext *ctx )
{
- GLboolean rgbmode = ctx->Visual->RGBAflag;
+ GLboolean rgbmode = ctx->Visual.RGBAflag;
/* TODO: antialiased lines */
if (ctx->RenderMode==GL_RENDER) {
-/* $Id: matrix.c,v 1.20 2000/09/17 21:56:07 brianp Exp $ */
+/* $Id: matrix.c,v 1.21 2000/09/26 20:53:53 brianp Exp $ */
/*
* Mesa 3-D graphics library
ctx->Viewport.WindowMap.m[MAT_TX] = ctx->Viewport.WindowMap.m[MAT_SX] + x;
ctx->Viewport.WindowMap.m[MAT_SY] = (GLfloat) height / 2.0F;
ctx->Viewport.WindowMap.m[MAT_TY] = ctx->Viewport.WindowMap.m[MAT_SY] + y;
- ctx->Viewport.WindowMap.m[MAT_SZ] = 0.5 * ctx->Visual->DepthMaxF;
- ctx->Viewport.WindowMap.m[MAT_TZ] = 0.5 * ctx->Visual->DepthMaxF;
+ ctx->Viewport.WindowMap.m[MAT_SZ] = 0.5 * ctx->Visual.DepthMaxF;
+ ctx->Viewport.WindowMap.m[MAT_TZ] = 0.5 * ctx->Visual.DepthMaxF;
ctx->Viewport.WindowMap.flags = MAT_FLAG_GENERAL_SCALE|MAT_FLAG_TRANSLATION;
ctx->Viewport.WindowMap.type = MATRIX_3D_NO_ROT;
ctx->Viewport.Near = n;
ctx->Viewport.Far = f;
- ctx->Viewport.WindowMap.m[MAT_SZ] = ctx->Visual->DepthMaxF * ((f - n) / 2.0);
- ctx->Viewport.WindowMap.m[MAT_TZ] = ctx->Visual->DepthMaxF * ((f - n) / 2.0 + n);
+ ctx->Viewport.WindowMap.m[MAT_SZ] = ctx->Visual.DepthMaxF * ((f - n) / 2.0);
+ ctx->Viewport.WindowMap.m[MAT_TZ] = ctx->Visual.DepthMaxF * ((f - n) / 2.0 + n);
ctx->ModelProjectWinMatrixUptodate = GL_FALSE;
-/* $Id: points.c,v 1.12 2000/08/16 17:26:06 brianp Exp $ */
+/* $Id: points.c,v 1.13 2000/09/26 20:53:53 brianp Exp $ */
/*
* Mesa 3-D graphics library
*/
void gl_set_point_function( GLcontext *ctx )
{
- GLboolean rgbmode = ctx->Visual->RGBAflag;
+ GLboolean rgbmode = ctx->Visual.RGBAflag;
if (ctx->RenderMode==GL_RENDER) {
if (ctx->NoRaster) {
-/* $Id: polygon.c,v 1.11 2000/03/13 18:32:37 brianp Exp $ */
+/* $Id: polygon.c,v 1.12 2000/09/26 20:53:53 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.3
+ * Version: 3.5
*
* Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
*
{
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPolygonOffsetEXT");
- _mesa_PolygonOffset(factor, bias * ctx->Visual->DepthMaxF );
+ _mesa_PolygonOffset(factor, bias * ctx->Visual.DepthMaxF );
}
-/* $Id: rastpos.c,v 1.6 2000/03/03 17:47:39 brianp Exp $ */
+/* $Id: rastpos.c,v 1.7 2000/09/26 20:53:53 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.3
+ * Version: 3.5
*
* Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
*
}
else {
/* use current color or index */
- if (ctx->Visual->RGBAflag) {
+ if (ctx->Visual.RGBAflag) {
UBYTE_RGBA_TO_FLOAT_RGBA(ctx->Current.RasterColor,
ctx->Current.ByteColor);
}
ctx->Current.RasterPos[1] = (ndc[1] * ctx->Viewport.WindowMap.m[MAT_SY] +
ctx->Viewport.WindowMap.m[MAT_TY]);
ctx->Current.RasterPos[2] = (ndc[2] * ctx->Viewport.WindowMap.m[MAT_SZ] +
- ctx->Viewport.WindowMap.m[MAT_TZ]) / ctx->Visual->DepthMaxF;
+ ctx->Viewport.WindowMap.m[MAT_TZ]) / ctx->Visual.DepthMaxF;
ctx->Current.RasterPos[3] = clip[3];
ctx->Current.RasterPosValid = GL_TRUE;
-/* $Id: state.c,v 1.27 2000/09/08 22:07:29 brianp Exp $ */
+/* $Id: state.c,v 1.28 2000/09/26 20:53:53 brianp Exp $ */
/*
* Mesa 3-D graphics library
if (ctx->FogMode == FOG_FRAGMENT) ctx->RasterMask |= FOG_BIT;
if (ctx->Scissor.Enabled) ctx->RasterMask |= SCISSOR_BIT;
if (ctx->Stencil.Enabled) ctx->RasterMask |= STENCIL_BIT;
- if (ctx->Visual->RGBAflag) {
+ if (ctx->Visual.RGBAflag) {
const GLuint colorMask = *((GLuint *) &ctx->Color.ColorMask);
if (colorMask != 0xffffffff) ctx->RasterMask |= MASKING_BIT;
if (ctx->Color.ColorLogicOpEnabled) ctx->RasterMask |= LOGIC_OP_BIT;
ctx->RasterMask |= MULTI_DRAW_BIT;
ctx->TriangleCaps |= DD_MULTIDRAW;
}
- else if (ctx->Visual->RGBAflag && *((GLuint *) ctx->Color.ColorMask) == 0) {
+ else if (ctx->Visual.RGBAflag && *((GLuint *) ctx->Color.ColorMask) == 0) {
/* all RGBA channels disabled */
ctx->RasterMask |= MULTI_DRAW_BIT;
ctx->TriangleCaps |= DD_MULTIDRAW;
}
- else if (!ctx->Visual->RGBAflag && ctx->Color.IndexMask==0) {
+ else if (!ctx->Visual.RGBAflag && ctx->Color.IndexMask==0) {
/* all color index bits disabled */
ctx->RasterMask |= MULTI_DRAW_BIT;
ctx->TriangleCaps |= DD_MULTIDRAW;
-/* $Id: stencil.c,v 1.18 2000/09/08 21:28:04 brianp Exp $ */
+/* $Id: stencil.c,v 1.19 2000/09/26 20:53:53 brianp Exp $ */
/*
* Mesa 3-D graphics library
static void
clear_software_stencil_buffer( GLcontext *ctx )
{
- if (ctx->Visual->StencilBits==0 || !ctx->DrawBuffer->Stencil) {
+ if (ctx->Visual.StencilBits==0 || !ctx->DrawBuffer->Stencil) {
/* no stencil buffer */
return;
}