From 5a9026c65d260dc185e072163999f5d810015108 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 17 Nov 2000 21:01:25 +0000 Subject: [PATCH] Minor header file changes to silence warnings. Added _mesa_enable_sw_extensions(), called by software-only drivers to enable all s/w-supported GL extensions. --- src/mesa/drivers/beos/GLView.cpp | 10 +++++++++- src/mesa/drivers/ggi/ggimesa.c | 3 +++ src/mesa/drivers/glide/fxdd.c | 21 --------------------- src/mesa/drivers/osmesa/osmesa.c | 8 ++++---- src/mesa/drivers/svga/svgamesa.c | 7 +++++-- src/mesa/drivers/windows/wmesa.c | 4 +++- src/mesa/drivers/x11/xm_api.c | 6 ++---- src/mesa/main/extensions.c | 17 ++++++++++++++++- src/mesa/main/extensions.h | 5 ++++- src/mesa/math/m_translate.h | 8 ++++++-- src/mesa/math/m_xform.c | 3 ++- src/mesa/math/m_xform.h | 6 ++++-- 12 files changed, 58 insertions(+), 40 deletions(-) diff --git a/src/mesa/drivers/beos/GLView.cpp b/src/mesa/drivers/beos/GLView.cpp index 44e51a58dbb..56c1b7773b9 100644 --- a/src/mesa/drivers/beos/GLView.cpp +++ b/src/mesa/drivers/beos/GLView.cpp @@ -1,4 +1,4 @@ -/* $Id: GLView.cpp,v 1.4 2000/11/14 17:51:15 brianp Exp $ */ +/* $Id: GLView.cpp,v 1.5 2000/11/17 21:01:26 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -27,6 +27,11 @@ /* * $Log: GLView.cpp,v $ + * Revision 1.5 2000/11/17 21:01:26 brianp + * Minor header file changes to silence warnings. + * Added _mesa_enable_sw_extensions(), called by software-only drivers + * to enable all s/w-supported GL extensions. + * * Revision 1.4 2000/11/14 17:51:15 brianp * more Driver.Color, Driver.Index updates * @@ -71,6 +76,7 @@ #include #include #include "../src/context.h" +#include "extensions.h" // BeOS component ordering for B_RGBA32 bitmap format @@ -1037,6 +1043,8 @@ BGLView::BGLView(BRect rect, char *name, const GLboolean direct = GL_TRUE; GLcontext *ctx = _mesa_create_context( visual, NULL, aux, direct ); + _mesa_enable_sw_extensions(ctx); + aux->Init(this, ctx, visual, buffer ); // Hook aux data into BGLView object diff --git a/src/mesa/drivers/ggi/ggimesa.c b/src/mesa/drivers/ggi/ggimesa.c index 764ccba803e..fffbaa5f4ff 100644 --- a/src/mesa/drivers/ggi/ggimesa.c +++ b/src/mesa/drivers/ggi/ggimesa.c @@ -30,6 +30,7 @@ #include #include +#include "extensions.h" #undef VIS #undef FLIP @@ -319,6 +320,8 @@ GGIMesaContext GGIMesaCreateContext(void) if (!ctx->gl_ctx) return NULL; + _mesa_enable_sw_extensions(ctx->gl_ctx); + return ctx; } diff --git a/src/mesa/drivers/glide/fxdd.c b/src/mesa/drivers/glide/fxdd.c index 178fa192ac0..6dbbec4d593 100644 --- a/src/mesa/drivers/glide/fxdd.c +++ b/src/mesa/drivers/glide/fxdd.c @@ -121,22 +121,6 @@ static void fxDDBufferSize(GLcontext *ctx, GLuint *width, GLuint *height) } -/* Set current drawing color */ -static void fxDDSetColor(GLcontext *ctx, GLubyte red, GLubyte green, - GLubyte blue, GLubyte alpha ) -{ - fxMesaContext fxMesa=(fxMesaContext)ctx->DriverCtx; - GLubyte col[4]; - ASSIGN_4V( col, red, green, blue, alpha ); - - if (MESA_VERBOSE&VERBOSE_DRIVER) { - fprintf(stderr,"fxmesa: fxDDSetColor(%d,%d,%d,%d)\n",red,green,blue,alpha); - } - - fxMesa->color=FXCOLOR4(col); -} - - /* Implements glClearColor() */ static void fxDDClearColor(GLcontext *ctx, GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha ) @@ -976,11 +960,6 @@ void fxSetupDDPointers(GLcontext *ctx) ctx->Driver.ClearColor=fxDDClearColor; ctx->Driver.Clear=fxDDClear; -#if 0 - ctx->Driver.Index=NULL; - ctx->Driver.Color=fxDDSetColor; -#endif - ctx->Driver.SetDrawBuffer=fxDDSetDrawBuffer; ctx->Driver.SetReadBuffer=fxDDSetReadBuffer; ctx->Driver.GetBufferSize=fxDDBufferSize; diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c index 74850556a76..9f7280564cc 100644 --- a/src/mesa/drivers/osmesa/osmesa.c +++ b/src/mesa/drivers/osmesa/osmesa.c @@ -1,4 +1,4 @@ -/* $Id: osmesa.c,v 1.31 2000/11/16 21:05:38 keithw Exp $ */ +/* $Id: osmesa.c,v 1.32 2000/11/17 21:01:40 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -53,6 +53,7 @@ #include "swrast/s_depth.h" #include "swrast/s_lines.h" #include "swrast/s_triangle.h" +#include "tnl/tnl.h" #endif @@ -273,9 +274,8 @@ OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits, FREE(osmesa); return NULL; } - gl_extensions_enable(&(osmesa->gl_ctx),"GL_HP_occlusion_test"); - gl_extensions_enable(&(osmesa->gl_ctx), "GL_ARB_texture_cube_map"); - gl_extensions_enable(&(osmesa->gl_ctx), "GL_EXT_texture_env_combine"); + + _mesa_enable_sw_extensions(&(osmesa->gl_ctx)); osmesa->gl_buffer = _mesa_create_framebuffer( osmesa->gl_visual, osmesa->gl_visual->DepthBits > 0, diff --git a/src/mesa/drivers/svga/svgamesa.c b/src/mesa/drivers/svga/svgamesa.c index 5163e08ece6..4a6c34b4f0c 100644 --- a/src/mesa/drivers/svga/svgamesa.c +++ b/src/mesa/drivers/svga/svgamesa.c @@ -1,4 +1,4 @@ -/* $Id: svgamesa.c,v 1.8 2000/11/16 21:05:39 keithw Exp $ */ +/* $Id: svgamesa.c,v 1.9 2000/11/17 21:01:44 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -39,12 +39,13 @@ #else #include #include +#include #include #include "GL/svgamesa.h" #include "context.h" +#include "extensions.h" #include "matrix.h" #include "types.h" -#include #endif #include "svgapix.h" @@ -418,6 +419,8 @@ SVGAMesaContext SVGAMesaCreateContext( GLboolean doubleBuffer ) NULL, /* share list context */ (void *) ctx, GL_TRUE ); + _mesa_enable_sw_extensions(ctx->gl_ctx); + ctx->gl_buffer = _mesa_create_framebuffer( ctx->gl_vis, ctx->gl_vis->DepthBits > 0, ctx->gl_vis->StencilBits > 0, diff --git a/src/mesa/drivers/windows/wmesa.c b/src/mesa/drivers/windows/wmesa.c index 55c5c402afc..b55142e8add 100644 --- a/src/mesa/drivers/windows/wmesa.c +++ b/src/mesa/drivers/windows/wmesa.c @@ -1,4 +1,4 @@ -/* $Id: wmesa.c,v 1.11 2000/11/14 17:40:15 brianp Exp $ */ +/* $Id: wmesa.c,v 1.12 2000/11/17 21:01:47 brianp Exp $ */ /* * Windows (Win32) device driver for Mesa 3.4 @@ -1284,6 +1284,8 @@ WMesaContext WMesaCreateContext( HWND hWnd, HPALETTE* Pal, return NULL; } + _mesa_enable_sw_extensions(c->gl_ctx); + c->gl_buffer = _mesa_create_framebuffer( c->gl_visual, c->gl_visual->DepthBits > 0, c->gl_visual->StencilBits > 0, diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c index f48da3bbfe5..412d1eed966 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.8 2000/11/16 21:05:40 keithw Exp $ */ +/* $Id: xm_api.c,v 1.9 2000/11/17 21:01:48 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -1638,9 +1638,7 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list ) return NULL; } - gl_extensions_enable(ctx, "GL_HP_occlusion_test"); - gl_extensions_enable(ctx, "GL_ARB_texture_cube_map"); - gl_extensions_enable(ctx, "GL_EXT_texture_env_combine"); + _mesa_enable_sw_extensions(ctx); if (CHECK_BYTE_ORDER(v)) { c->swapbytes = GL_FALSE; diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index c83b112763f..a36e6b00bee 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -1,4 +1,4 @@ -/* $Id: extensions.c,v 1.40 2000/10/30 16:27:21 brianp Exp $ */ +/* $Id: extensions.c,v 1.41 2000/11/17 21:01:25 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -109,6 +109,21 @@ static struct { +/* + * Enable all extensions suitable for a software-only renderer. + * This is a convenience function used by the XMesa, OSMesa, GGI drivers, etc. + */ +void +_mesa_enable_sw_extensions(GLcontext *ctx) +{ + gl_extensions_enable(ctx, "GL_ARB_texture_cube_map"); + gl_extensions_enable(ctx, "GL_EXT_bgra"); + gl_extensions_enable(ctx, "GL_EXT_texture_env_combine"); + gl_extensions_enable(ctx, "GL_HP_occlusion_test"); + gl_extensions_enable(ctx, "GL_NV_blend_square"); +} + + int gl_extensions_add( GLcontext *ctx, GLboolean enabled, diff --git a/src/mesa/main/extensions.h b/src/mesa/main/extensions.h index 4c861b32ac3..f11926b1966 100644 --- a/src/mesa/main/extensions.h +++ b/src/mesa/main/extensions.h @@ -1,4 +1,4 @@ -/* $Id: extensions.h,v 1.9 2000/10/30 13:32:00 keithw Exp $ */ +/* $Id: extensions.h,v 1.10 2000/11/17 21:01:25 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -31,6 +31,9 @@ #include "types.h" +extern void +_mesa_enable_sw_extensions(GLcontext *ctx); + /* Return 0 on success. */ diff --git a/src/mesa/math/m_translate.h b/src/mesa/math/m_translate.h index 5c60b972ff5..a109dfa721b 100644 --- a/src/mesa/math/m_translate.h +++ b/src/mesa/math/m_translate.h @@ -1,4 +1,4 @@ -/* $Id: m_translate.h,v 1.1 2000/11/16 21:05:41 keithw Exp $ */ +/* $Id: m_translate.h,v 1.2 2000/11/17 21:01:49 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -28,6 +28,8 @@ #ifndef _M_TRANSLATE_H_ #define _M_TRANSLATE_H_ +#include "config.h" + typedef void (*trans_1f_func)(GLfloat *to, CONST void *ptr, @@ -86,7 +88,9 @@ extern trans_4ub_func gl_trans_4ub_tab[5][MAX_TYPES]; extern trans_4f_func gl_trans_4f_tab[5][MAX_TYPES]; -extern void gl_init_translate( void ); + +extern void +_math_init_translate( void ); #endif diff --git a/src/mesa/math/m_xform.c b/src/mesa/math/m_xform.c index 6bc6a9cea3b..7509a350d80 100644 --- a/src/mesa/math/m_xform.c +++ b/src/mesa/math/m_xform.c @@ -1,4 +1,4 @@ -/* $Id: m_xform.c,v 1.1 2000/11/16 21:05:41 keithw Exp $ */ +/* $Id: m_xform.c,v 1.2 2000/11/17 21:01:49 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -41,6 +41,7 @@ #include "mmath.h" #include "m_matrix.h" +#include "m_translate.h" #include "m_xform.h" diff --git a/src/mesa/math/m_xform.h b/src/mesa/math/m_xform.h index 1c6ac461e82..7fc5be3ab15 100644 --- a/src/mesa/math/m_xform.h +++ b/src/mesa/math/m_xform.h @@ -1,4 +1,4 @@ -/* $Id: m_xform.h,v 1.1 2000/11/16 21:05:41 keithw Exp $ */ +/* $Id: m_xform.h,v 1.2 2000/11/17 21:01:49 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -34,6 +34,7 @@ #include "glheader.h" #include "config.h" +#include "math/math.h" #include "math/m_vector.h" #include "math/m_matrix.h" @@ -78,7 +79,8 @@ extern void gl_transform_vector( GLfloat u[4], const GLfloat m[16] ); -extern void gl_init_transformation( void ); +extern void +_math_init_transformation( void ); /* KW: Clip functions now do projective divide as well. The projected -- 2.30.2