diff options
author | Brian Paul <[email protected]> | 2000-09-26 20:53:53 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2000-09-26 20:53:53 +0000 |
commit | b1394fa92aaaf859ce9efc8b5fc194397921320c (patch) | |
tree | 48612380d5f16b24deacf643e127fc1b319fbc18 /src/mesa/drivers | |
parent | 3b18a36f210da9d66acd1228d24948cd77c2e81e (diff) |
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.
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r-- | src/mesa/drivers/allegro/amesa.c | 112 | ||||
-rw-r--r-- | src/mesa/drivers/beos/GLView.cpp | 41 | ||||
-rw-r--r-- | src/mesa/drivers/d3d/WGL.C | 68 | ||||
-rw-r--r-- | src/mesa/drivers/dos/dosmesa.c | 52 | ||||
-rw-r--r-- | src/mesa/drivers/ggi/ggimesa.c | 39 | ||||
-rw-r--r-- | src/mesa/drivers/glide/fxapi.c | 46 | ||||
-rw-r--r-- | src/mesa/drivers/glide/fxdd.c | 2 | ||||
-rw-r--r-- | src/mesa/drivers/osmesa/osmesa.c | 36 | ||||
-rw-r--r-- | src/mesa/drivers/svga/svgamesa.c | 52 | ||||
-rw-r--r-- | src/mesa/drivers/windows/wmesa.c | 38 | ||||
-rw-r--r-- | src/mesa/drivers/windows/wmesa_stereo.c | 35 | ||||
-rw-r--r-- | src/mesa/drivers/x11/xm_api.c | 52 | ||||
-rw-r--r-- | src/mesa/drivers/x11/xm_line.c | 4 | ||||
-rw-r--r-- | src/mesa/drivers/x11/xm_tri.c | 6 | ||||
-rw-r--r-- | src/mesa/drivers/x11/xmesaP.h | 4 |
15 files changed, 305 insertions, 282 deletions
diff --git a/src/mesa/drivers/allegro/amesa.c b/src/mesa/drivers/allegro/amesa.c index 6e0f21d804d..1645c5d11c9 100644 --- a/src/mesa/drivers/allegro/amesa.c +++ b/src/mesa/drivers/allegro/amesa.c @@ -248,15 +248,18 @@ AMesaVisual AMesaCreateVisual(GLboolean dbFlag, GLint depth, visual->DBFlag = dbFlag;
visual->Depth = depth;
- visual->GLVisual = gl_create_visual(GL_TRUE, /* rgb mode */
- GL_TRUE, /* software alpha */
- dbFlag, /* db_flag */
- GL_FALSE, /* stereo */
- depthSize, /* depth bits */
- stencilSize,/* stencil bits */
- accumSize, /* accum bits */
- 0, /* index bits */
- redBits, greenBits, blueBits, 0);
+ visual->GLVisual = _mesa_create_visual(GL_TRUE, /* rgb mode */
+ dbFlag, /* db_flag */
+ GL_FALSE, /* stereo */
+ redBits, greenBits, blueBits, 8,
+ 0, /* index bits */
+ depthSize, /* depth bits */
+ stencilSize,/* stencil bits */
+ accumSize, /* accum bits */
+ accumSize, /* accum bits */
+ accumSize, /* accum bits */
+ accumSize, /* accum bits */
+ 1 );
if (!visual->GLVisual)
{
free(visual);
@@ -269,8 +272,8 @@ AMesaVisual AMesaCreateVisual(GLboolean dbFlag, GLint depth, void AMesaDestroyVisual(AMesaVisual visual)
{
- gl_destroy_visual(visual->GLVisual);
- free(visual);
+ _mesa_destroy_visual(visual->GLVisual);
+ free(visual);
}
@@ -299,7 +302,7 @@ AMesaBuffer AMesaCreateBuffer(AMesaVisual visual, }
}
- buffer->GLBuffer = gl_create_framebuffer(visual->GLVisual);
+ buffer->GLBuffer = _mesa_create_framebuffer(visual->GLVisual);
if (!buffer->GLBuffer)
{
if (buffer->Background) destroy_bitmap(buffer->Background);
@@ -312,12 +315,12 @@ AMesaBuffer AMesaCreateBuffer(AMesaVisual visual, void AMesaDestroyBuffer(AMesaBuffer buffer)
- {
- if (buffer->Screen) destroy_bitmap(buffer->Screen);
- if (buffer->Background) destroy_bitmap(buffer->Background);
- gl_destroy_framebuffer(buffer->GLBuffer);
- free(buffer);
- }
+{
+ if (buffer->Screen) destroy_bitmap(buffer->Screen);
+ if (buffer->Background) destroy_bitmap(buffer->Background);
+ _mesa_destroy_framebuffer(buffer->GLBuffer);
+ free(buffer);
+}
AMesaContext AMesaCreateContext(AMesaVisual visual,
@@ -334,7 +337,7 @@ AMesaContext AMesaCreateContext(AMesaVisual visual, context->Buffer = NULL;
context->ClearColor = 0;
context->CurrentColor = 0;
- context->GLContext = gl_create_context(visual->GLVisual,
+ context->GLContext = _mesa_create_context(visual->GLVisual,
share ? share->GLContext : NULL,
(void*)context,
direct);
@@ -349,47 +352,44 @@ AMesaContext AMesaCreateContext(AMesaVisual visual, void AMesaDestroyContext(AMesaContext context)
- {
- gl_destroy_context(context->GLContext);
- free(context);
- }
+{
+ _mesa_destroy_context(context->GLContext);
+ free(context);
+}
GLboolean AMesaMakeCurrent(AMesaContext context, AMesaBuffer buffer)
- {
- if (context && buffer)
- {
- set_color_depth(context->Visual->Depth);
- if (set_gfx_mode(GFX_AUTODETECT, buffer->Width, buffer->Height, 0, 0) != 0)
- return GL_FALSE;
-
- context->Buffer = buffer;
- buffer->Screen = screen;
- buffer->Active = buffer->Background ? buffer->Background : screen;
+{
+ if (context && buffer) {
+ set_color_depth(context->Visual->Depth);
+ if (set_gfx_mode(GFX_AUTODETECT, buffer->Width, buffer->Height, 0, 0) != 0)
+ return GL_FALSE;
+
+ context->Buffer = buffer;
+ buffer->Screen = screen;
+ buffer->Active = buffer->Background ? buffer->Background : screen;
- setup_dd_pointers(context->GLContext);
- gl_make_current(context->GLContext, buffer->GLBuffer);
- gl_Viewport(context->GLContext, 0, 0, buffer->Width, buffer->Height);
- }
- else
- {
- destroy_bitmap(context->Buffer->Screen);
- context->Buffer->Screen = NULL;
- context->Buffer->Active = NULL;
- context->Buffer = NULL;
- gl_make_current(NULL, NULL);
- }
-
- return GL_TRUE;
- }
+ setup_dd_pointers(context->GLContext);
+ _mesa_make_current(context->GLContext, buffer->GLBuffer);
+ gl_Viewport(context->GLContext, 0, 0, buffer->Width, buffer->Height);
+ }
+ else {
+ destroy_bitmap(context->Buffer->Screen);
+ context->Buffer->Screen = NULL;
+ context->Buffer->Active = NULL;
+ context->Buffer = NULL;
+ _mesa_make_current(NULL, NULL);
+ }
+
+ return GL_TRUE;
+}
void AMesaSwapBuffers(AMesaBuffer buffer)
- {
- if (buffer->Background)
- {
- blit(buffer->Background, buffer->Screen,
- 0, 0, 0, 0,
- buffer->Width, buffer->Height);
- }
- }
+{
+ if (buffer->Background) {
+ blit(buffer->Background, buffer->Screen,
+ 0, 0, 0, 0,
+ buffer->Width, buffer->Height);
+ }
+}
diff --git a/src/mesa/drivers/beos/GLView.cpp b/src/mesa/drivers/beos/GLView.cpp index 45ed1b49cea..5bf0b4926c8 100644 --- a/src/mesa/drivers/beos/GLView.cpp +++ b/src/mesa/drivers/beos/GLView.cpp @@ -1,10 +1,10 @@ -/* $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"), @@ -27,6 +27,13 @@ /* * $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 * @@ -242,9 +249,9 @@ AuxInfo::AuxInfo() 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); } @@ -260,7 +267,7 @@ void AuxInfo::Init(BGLView *bglView, GLcontext *c, GLvisual *v, GLframebuffer *b void AuxInfo::MakeCurrent() { UpdateState(mContext); - gl_make_current(mContext, mBuffer); + _mesa_make_current(mContext, mBuffer); } @@ -1008,13 +1015,19 @@ BGLView::BGLView(BRect rect, char *name, 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, @@ -1023,7 +1036,7 @@ BGLView::BGLView(BRect rect, char *name, // 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 ); @@ -1051,7 +1064,7 @@ void BGLView::UnlockGL() { 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 } diff --git a/src/mesa/drivers/d3d/WGL.C b/src/mesa/drivers/d3d/WGL.C index 2d1a6a0c4d5..e3b95e1de72 100644 --- a/src/mesa/drivers/d3d/WGL.C +++ b/src/mesa/drivers/d3d/WGL.C @@ -147,15 +147,15 @@ static BOOL InitOpenGL( HINSTANCE hInst ) /*========================================================================*/
/* Do all core Mesa stuff. */
/*========================================================================*/
- pD3DDefault->gl_visual = gl_create_visual( TRUE,
- GL_FALSE, /* software alpha */
- FALSE, /* 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 */
+ pD3DDefault->gl_visual = _mesa_create_visual( TRUE,
+ FALSE, /* db_flag */
+ GL_FALSE, /* stereo */
+ 8,8,8,8, /* r, g, b, a bits */
+ 0, /* index bits */
+ 16, /* depth_bits */
+ 8, /* stencil_bits */
+ 8,8,8,8, /* accum_bits */
+ 1 );
if ( pD3DDefault->gl_visual == NULL)
{
@@ -164,25 +164,25 @@ static BOOL InitOpenGL( HINSTANCE hInst ) }
/* Allocate a new Mesa context */
- pD3DDefault->gl_ctx = gl_create_context( pD3DDefault->gl_visual, NULL, pD3DDefault, GL_TRUE );
+ pD3DDefault->gl_ctx = _mesa_create_context( pD3DDefault->gl_visual, NULL, pD3DDefault, GL_TRUE );
if ( pD3DDefault->gl_ctx == NULL )
{
- gl_destroy_visual( pD3DDefault->gl_visual );
+ _mesa_destroy_visual( pD3DDefault->gl_visual );
FREE( pD3DDefault );
return FALSE;
}
/* Allocate a new Mesa frame buffer */
- pD3DDefault->gl_buffer = gl_create_framebuffer( pD3DDefault->gl_visual );
+ pD3DDefault->gl_buffer = _mesa_create_framebuffer( pD3DDefault->gl_visual );
if ( pD3DDefault->gl_buffer == NULL )
{
- gl_destroy_visual( pD3DDefault->gl_visual );
- gl_destroy_context( pD3DDefault->gl_ctx );
+ _mesa_destroy_visual( pD3DDefault->gl_visual );
+ _mesa_destroy_context( pD3DDefault->gl_ctx );
FREE( pD3DDefault );
return FALSE;
}
SetupDDPointers( pD3DDefault->gl_ctx );
- gl_make_current( pD3DDefault->gl_ctx, pD3DDefault->gl_buffer );
+ _mesa_make_current( pD3DDefault->gl_ctx, pD3DDefault->gl_buffer );
return TRUE;
}
@@ -214,15 +214,15 @@ HGLRC APIENTRY wglCreateContext( HDC hdc ) /*========================================================================*/
/* TODO: support more then one visual. */
- pNewContext->gl_visual = gl_create_visual( TRUE,
- GL_TRUE, /* software alpha */
- TRUE, /* 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 */
+ pNewContext->gl_visual = _mesa_create_visual( TRUE,
+ TRUE, /* 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 ( pNewContext->gl_visual == NULL)
{
FREE( pNewContext );
@@ -231,21 +231,21 @@ HGLRC APIENTRY wglCreateContext( HDC hdc ) }
/* Allocate a new Mesa context */
- pNewContext->gl_ctx = gl_create_context( pNewContext->gl_visual, NULL, pNewContext, GL_TRUE );
+ pNewContext->gl_ctx = _mesa_create_context( pNewContext->gl_visual, NULL, pNewContext, GL_TRUE );
if ( pNewContext->gl_ctx == NULL )
{
- gl_destroy_visual( pNewContext->gl_visual );
+ _mesa_destroy_visual( pNewContext->gl_visual );
FREE( pNewContext );
SetLastError( 0 );
return (HGLRC)NULL;
}
/* Allocate a new Mesa frame buffer */
- pNewContext->gl_buffer = gl_create_framebuffer( pNewContext->gl_visual );
+ pNewContext->gl_buffer = _mesa_create_framebuffer( pNewContext->gl_visual );
if ( pNewContext->gl_buffer == NULL )
{
- gl_destroy_visual( pNewContext->gl_visual );
- gl_destroy_context( pNewContext->gl_ctx );
+ _mesa_destroy_visual( pNewContext->gl_visual );
+ _mesa_destroy_context( pNewContext->gl_ctx );
FREE( pNewContext );
SetLastError( 0 );
return (HGLRC)NULL;
@@ -314,7 +314,7 @@ static BOOL MakeCurrent( D3DMESACONTEXT *pContext ) /* Let Mesa-3.0 we have a new context. */
/*=====================================*/
SetupDDPointers( pContext->gl_ctx );
- gl_make_current( pContext->gl_ctx, pContext->gl_buffer );
+ _mesa_make_current( pContext->gl_ctx, pContext->gl_buffer );
/* We are done so set the internal current context. */
if ( pContext != pD3DDefault )
@@ -409,7 +409,7 @@ static BOOL ResizeContext( GLcontext *ctx ) /* Update Mesa as we might have changed from SW <-> HW. */
SetupDDPointers( pContext->gl_ctx );
- gl_make_current( pContext->gl_ctx, pContext->gl_buffer );
+ _mesa_make_current( pContext->gl_ctx, pContext->gl_buffer );
/* If we are in HW we need to load the current texture if there is one already. */
// if ( (ctx->Texture.Set[ctx->Texture.CurrentSet].Current != NULL) &&
@@ -1076,17 +1076,17 @@ static void DestroyContext( D3DMESACONTEXT *pContext ) /* Free the Mesa stuff. */
if ( pContext->gl_visual )
{
- gl_destroy_visual( pContext->gl_visual );
+ _mesa_destroy_visual( pContext->gl_visual );
pContext->gl_visual = NULL;
}
if ( pContext->gl_buffer )
{
- gl_destroy_framebuffer( pContext->gl_buffer );
+ _mesa_destroy_framebuffer( pContext->gl_buffer );
pContext->gl_buffer = NULL;
}
if ( pContext->gl_ctx )
{
- gl_destroy_context( pContext->gl_ctx );
+ _mesa_destroy_context( pContext->gl_ctx );
pContext->gl_ctx = NULL;
}
diff --git a/src/mesa/drivers/dos/dosmesa.c b/src/mesa/drivers/dos/dosmesa.c index 2f3973284a6..6221268b52d 100644 --- a/src/mesa/drivers/dos/dosmesa.c +++ b/src/mesa/drivers/dos/dosmesa.c @@ -1,4 +1,4 @@ -/* $Id: dosmesa.c,v 1.1 1999/08/19 00:55:41 jtg Exp $ */
+/* $Id: dosmesa.c,v 1.2 2000/09/26 20:54:10 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -23,8 +23,15 @@ /*
* $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 @@ -1406,26 +1413,25 @@ DOSMesaContext DOSMesaCreateContext( void ) return NULL;
}
- ctx->gl_vis = gl_create_visual( rgb_flag,
- alpha_flag,
- db_flag,
- 16, /* depth_size */
- 8, /* stencil_size */
- 16, /* accum_size */
- index_bits,
- redscale,
- greenscale,
- bluescale,
- alphascale,
- redbits, greenbits,
- bluebits, alphabits);
-
- ctx->gl_ctx = gl_create_context( ctx->gl_vis,
+ ctx->gl_vis = _mesa_create_visual( rgb_flag,
+ db_flag,
+ GL_FALSE, /* stereo */
+ redbits,
+ greenbits,
+ bluebits,
+ alphabits,
+ index_bits,
+ 16, /* depth_size */
+ 8, /* stencil_size */
+ 16, 16, 16, 16, /* accum_size */
+ 1 ); +
+ ctx->gl_ctx = _mesa_create_context( ctx->gl_vis,
NULL, /* share list context */
(void *) ctx
);
- ctx->gl_buffer = gl_create_framebuffer( ctx->gl_vis );
+ ctx->gl_buffer = _mesa_create_framebuffer( ctx->gl_vis );
ctx->index = 1;
ctx->red = ctx->green = ctx->blue = 255;
@@ -1441,9 +1447,9 @@ DOSMesaContext DOSMesaCreateContext( void ) void DOSMesaDestroyContext( DOSMesaContext ctx )
{
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==DOSMesa) {
DOSMesa = NULL;
@@ -1459,7 +1465,7 @@ void DOSMesaDestroyContext( DOSMesaContext ctx ) void DOSMesaMakeCurrent( DOSMesaContext ctx )
{
DOSMesa = ctx;
- gl_make_current( ctx->gl_ctx, ctx->gl_buffer );
+ _mesa_make_current( ctx->gl_ctx, ctx->gl_buffer );
DOSmesa_setup_DD_pointers( ctx->gl_ctx );
if (ctx->width==0 || ctx->height==0) {
diff --git a/src/mesa/drivers/ggi/ggimesa.c b/src/mesa/drivers/ggi/ggimesa.c index 6e8dd47e747..2311959f5fa 100644 --- a/src/mesa/drivers/ggi/ggimesa.c +++ b/src/mesa/drivers/ggi/ggimesa.c @@ -317,7 +317,7 @@ GGIMesaContext GGIMesaCreateContext(void) 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; @@ -328,9 +328,9 @@ void GGIMesaDestroyContext(GGIMesaContext ctx) { 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) @@ -367,7 +367,7 @@ int GGIMesaSetVisual(GGIMesaContext ctx, ggi_visual_t 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); @@ -394,23 +394,26 @@ int GGIMesaSetVisual(GGIMesaContext ctx, ggi_visual_t vis, 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, @@ -461,7 +464,7 @@ int GGIMesaSetVisual(GGIMesaContext ctx, ggi_visual_t vis, 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) { @@ -485,7 +488,7 @@ void GGIMesaMakeCurrent(GGIMesaContext ctx) 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) { diff --git a/src/mesa/drivers/glide/fxapi.c b/src/mesa/drivers/glide/fxapi.c index 75d61c93a04..4166f792aa2 100644 --- a/src/mesa/drivers/glide/fxapi.c +++ b/src/mesa/drivers/glide/fxapi.c @@ -1061,25 +1061,25 @@ fxMesaContext GLAPIENTRY fxMesaCreateContext(GLuint win, 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; } @@ -1090,13 +1090,13 @@ fxMesaContext GLAPIENTRY fxMesaCreateContext(GLuint win, } - 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; } @@ -1134,11 +1134,11 @@ fxMesaContext GLAPIENTRY fxMesaCreateContext(GLuint win, 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); } @@ -1169,9 +1169,9 @@ void GLAPIENTRY fxMesaDestroyContext(fxMesaContext 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--; @@ -1226,7 +1226,7 @@ void GLAPIENTRY fxMesaMakeCurrent(fxMesaContext fxMesa) } if(!fxMesa) { - gl_make_current(NULL,NULL); + _mesa_make_current(NULL,NULL); fxMesaCurrentCtx=NULL; if (MESA_VERBOSE&VERBOSE_DRIVER) { @@ -1238,7 +1238,7 @@ void GLAPIENTRY fxMesaMakeCurrent(fxMesaContext fxMesa) /* 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"); } @@ -1254,7 +1254,7 @@ void GLAPIENTRY fxMesaMakeCurrent(fxMesaContext fxMesa) grSstSelect(fxMesa->board); grGlideSetState((GrState*)fxMesa->state); - gl_make_current(fxMesa->glCtx,fxMesa->glBuffer); + _mesa_make_current(fxMesa->glCtx,fxMesa->glBuffer); fxSetupDDPointers(fxMesa->glCtx); diff --git a/src/mesa/drivers/glide/fxdd.c b/src/mesa/drivers/glide/fxdd.c index a560fefa694..c0808c35df3 100644 --- a/src/mesa/drivers/glide/fxdd.c +++ b/src/mesa/drivers/glide/fxdd.c @@ -863,7 +863,7 @@ int fxDDInitFxMesaContext( fxMesaContext fxMesa ) fxMesa->glCtx->NrPipelineStages); /* Run the config file */ - gl_context_initialize( fxMesa->glCtx ); + _mesa_context_initialize( fxMesa->glCtx ); return 1; } diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c index 7f79a1f272e..11336e5cd9a 100644 --- a/src/mesa/drivers/osmesa/osmesa.c +++ b/src/mesa/drivers/osmesa/osmesa.c @@ -1,4 +1,4 @@ -/* $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 @@ -30,7 +30,7 @@ * * 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. */ @@ -265,15 +265,15 @@ OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits, 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; } @@ -308,9 +308,9 @@ OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits, 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 ); } } @@ -414,7 +414,7 @@ OSMesaMakeCurrent( OSMesaContext ctx, void *buffer, GLenum type, } 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; @@ -441,7 +441,7 @@ OSMesaMakeCurrent( OSMesaContext ctx, void *buffer, GLenum type, OSMesaContext GLAPIENTRY OSMesaGetCurrentContext( void ) { - GLcontext *ctx = gl_get_current_context(); + GLcontext *ctx = _mesa_get_current_context(); if (ctx) return (OSMesaContext) ctx; else @@ -1404,7 +1404,7 @@ static line_func choose_line_function( GLcontext *ctx ) 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: @@ -1429,7 +1429,7 @@ static line_func choose_line_function( GLcontext *ctx ) 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 @@ -1448,7 +1448,7 @@ static line_func choose_line_function( GLcontext *ctx ) 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 @@ -1586,7 +1586,7 @@ static triangle_func choose_triangle_function( GLcontext *ctx ) 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; diff --git a/src/mesa/drivers/svga/svgamesa.c b/src/mesa/drivers/svga/svgamesa.c index 1b4a45e1ae3..0d7fa158db5 100644 --- a/src/mesa/drivers/svga/svgamesa.c +++ b/src/mesa/drivers/svga/svgamesa.c @@ -1,4 +1,4 @@ -/* $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 @@ -369,7 +369,6 @@ SVGAMesaContext SVGAMesaCreateContext( GLboolean doubleBuffer ) #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 */ @@ -408,26 +407,27 @@ SVGAMesaContext SVGAMesaCreateContext( GLboolean doubleBuffer ) 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; @@ -444,9 +444,9 @@ void SVGAMesaDestroyContext( SVGAMesaContext ctx ) { #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; @@ -463,7 +463,7 @@ void SVGAMesaMakeCurrent( SVGAMesaContext ctx ) #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 */ diff --git a/src/mesa/drivers/windows/wmesa.c b/src/mesa/drivers/windows/wmesa.c index 01fea7f5a02..b372469288c 100644 --- a/src/mesa/drivers/windows/wmesa.c +++ b/src/mesa/drivers/windows/wmesa.c @@ -1,4 +1,4 @@ -/* $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 @@ -1280,37 +1280,37 @@ WMesaContext WMesaCreateContext( HWND hWnd, HPALETTE* Pal, #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; } @@ -1329,9 +1329,9 @@ void WMesaDestroyContext( void ) 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 @@ -1367,7 +1367,7 @@ void /*APIENTRY*/ WMesaMakeCurrent( WMesaContext c ) 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) { diff --git a/src/mesa/drivers/windows/wmesa_stereo.c b/src/mesa/drivers/windows/wmesa_stereo.c index 934e6a5f832..3408fe943c8 100644 --- a/src/mesa/drivers/windows/wmesa_stereo.c +++ b/src/mesa/drivers/windows/wmesa_stereo.c @@ -1181,32 +1181,33 @@ WMesaContext /*APIENTRY*/ WMesaCreateContext( HWND hWnd, HPALETTE Pal, - c->gl_visual = gl_create_visual(rgb_flag,
- GL_FALSE, /* software alpha */
- db_flag, /* db_flag */
- 16, /* depth_bits */
- 8, /* stencil_bits */
- 8, /* accum_bits */
- 8,
- 255.0, 255.0, 255.0, 255.0 );
+ c->gl_visual = _mesa_create_visual(rgb_flag,
+ db_flag, /* db_flag */
+ GL_TRUE, /* stereo */
+ 8, 8, 8, 8,/* rgba 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);
+ c->gl_ctx = _mesa_create_context( c->gl_visual, NULL,c);
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 );
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;
}
@@ -1223,9 +1224,9 @@ void /*APIENTRY*/ WMesaDestroyContext( void ) ReleaseDC(c->Window,c->hDC);
WC = c;
- 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){
wmDeleteBackingStore(c);
@@ -1267,7 +1268,7 @@ void /*APIENTRY*/ WMesaMakeCurrent( WMesaContext c ) 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);
Current = c;
setup_DD_pointers(c->gl_ctx);
if (Current->gl_ctx->Viewport.Width==0) {
diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c index 88650d675ad..5b31b8f7907 100644 --- a/src/mesa/drivers/x11/xm_api.c +++ b/src/mesa/drivers/x11/xm_api.c @@ -1,4 +1,4 @@ -/* $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 @@ -1629,7 +1629,7 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list ) 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) { @@ -1660,7 +1660,7 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list ) #endif /* Run the config file */ - gl_context_initialize( c->gl_ctx ); + _mesa_context_initialize( c->gl_ctx ); return c; } @@ -1675,7 +1675,7 @@ void XMesaDestroyContext( XMesaContext 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) @@ -1787,11 +1787,11 @@ XMesaBuffer XMesaCreateWindowBuffer2( XMesaVisual v, XMesaWindow w, 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; @@ -1799,7 +1799,7 @@ XMesaBuffer XMesaCreateWindowBuffer2( XMesaVisual v, XMesaWindow w, 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; } @@ -1929,13 +1929,13 @@ XMesaBuffer XMesaCreatePixmapBuffer( XMesaVisual v, 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; @@ -1943,7 +1943,7 @@ XMesaBuffer XMesaCreatePixmapBuffer( XMesaVisual v, 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; } @@ -2001,7 +2001,7 @@ void XMesaDestroyBuffer( XMesaBuffer b ) 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); } @@ -2044,7 +2044,7 @@ GLboolean XMesaMakeCurrent2( XMesaContext c, XMesaBuffer drawBuffer, 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) { @@ -2061,7 +2061,7 @@ GLboolean XMesaMakeCurrent2( XMesaContext c, XMesaBuffer drawBuffer, 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 */ @@ -2092,7 +2092,7 @@ GLboolean XMesaMakeCurrent2( XMesaContext c, XMesaBuffer drawBuffer, } else { /* Detach */ - gl_make_current2( NULL, NULL, NULL ); + _mesa_make_current2( NULL, NULL, NULL ); } return GL_TRUE; } @@ -2151,12 +2151,12 @@ XMesaBuffer XMesaGetCurrentReadBuffer( void ) 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; } @@ -2165,7 +2165,7 @@ GLboolean XMesaForceCurrent(XMesaContext c) GLboolean XMesaLoseCurrent(XMesaContext c) { (void) c; - gl_make_current(NULL, NULL); + _mesa_make_current(NULL, NULL); return GL_TRUE; } diff --git a/src/mesa/drivers/x11/xm_line.c b/src/mesa/drivers/x11/xm_line.c index 86b85eccba5..03af57b3bff 100644 --- a/src/mesa/drivers/x11/xm_line.c +++ b/src/mesa/drivers/x11/xm_line.c @@ -1,4 +1,4 @@ -/* $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 @@ -683,7 +683,7 @@ line_func xmesa_get_line_func( GLcontext *ctx ) && 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: diff --git a/src/mesa/drivers/x11/xm_tri.c b/src/mesa/drivers/x11/xm_tri.c index 870a2575733..29b97a03b0d 100644 --- a/src/mesa/drivers/x11/xm_tri.c +++ b/src/mesa/drivers/x11/xm_tri.c @@ -1,4 +1,4 @@ -/* $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 @@ -1548,7 +1548,7 @@ triangle_func xmesa_get_triangle_func( GLcontext *ctx ) && 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: @@ -1580,7 +1580,7 @@ triangle_func xmesa_get_triangle_func( GLcontext *ctx ) && 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: diff --git a/src/mesa/drivers/x11/xmesaP.h b/src/mesa/drivers/x11/xmesaP.h index 9d311f21f3d..ebea73981ff 100644 --- a/src/mesa/drivers/x11/xmesaP.h +++ b/src/mesa/drivers/x11/xmesaP.h @@ -1,4 +1,4 @@ -/* $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 @@ -127,7 +127,7 @@ struct xmesa_visual { /* - * "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 */ |