commit 2a353129ccc9c3d88716d51d3bd2e45951da2152 Author: George Sapountzis Date: Mon Apr 9 17:21:14 2007 +0300 xmesa: export xmesa functions used by xfree86. This avoids adding an explicit GLcore inteface which would not be a proper interface anyway. It puts the declarations of the three XMesa functions intented specifically for XFree86 in xmesa.h, we can push them down to xmesa_xf86.h if hiding is really necessary. diff --git a/include/GL/xmesa.h b/include/GL/xmesa.h index ab813b2..f185a15 100644 --- a/include/GL/xmesa.h +++ b/include/GL/xmesa.h @@ -180,6 +180,21 @@ extern XMesaContext XMesaCreateContext( XMesaVisual v, extern void XMesaDestroyContext( XMesaContext c ); +#ifdef XFree86Server +/* + * These are the extra routines required for integration with XFree86. + * None of these routines should be user visible. -KEM + */ +extern GLboolean XMesaForceCurrent( XMesaContext c ); + +extern GLboolean XMesaLoseCurrent( XMesaContext c ); + +extern GLboolean XMesaCopyContext( XMesaContext src, + XMesaContext dst, + GLuint mask ); +#endif /* XFree86Server */ + + /* * Create an XMesaBuffer from an X window. */ diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c index 24028a4..6439d13 100644 --- a/src/mesa/drivers/x11/xm_api.c +++ b/src/mesa/drivers/x11/xm_api.c @@ -1308,6 +1308,7 @@ xmesa_convert_from_x_visual_type( int visualType ) * visualCaveat - ala the GLX extension, usually GLX_NONE * Return; a new XMesaVisual or 0 if error. */ +PUBLIC XMesaVisual XMesaCreateVisual( XMesaDisplay *display, XMesaVisualInfo visinfo, GLboolean rgb_flag, @@ -1450,6 +1451,7 @@ XMesaVisual XMesaCreateVisual( XMesaDisplay *display, } +PUBLIC void XMesaDestroyVisual( XMesaVisual v ) { #ifndef XFree86Server @@ -1467,6 +1469,7 @@ void XMesaDestroyVisual( XMesaVisual v ) * lists or NULL if no sharing is wanted. * \return an XMesaContext or NULL if error. */ +PUBLIC XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list ) { static GLboolean firstTime = GL_TRUE; @@ -1550,6 +1553,7 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list ) +PUBLIC void XMesaDestroyContext( XMesaContext c ) { GLcontext *mesaCtx = &c->mesa; @@ -1721,7 +1725,7 @@ XMesaCreateWindowBuffer2(XMesaVisual v, XMesaWindow w, XMesaContext c) } -XMesaBuffer +PUBLIC XMesaBuffer XMesaCreateWindowBuffer(XMesaVisual v, XMesaWindow w) { return XMesaCreateWindowBuffer2( v, w, NULL ); @@ -1737,7 +1741,7 @@ XMesaCreateWindowBuffer(XMesaVisual v, XMesaWindow w) * \c GLX_DIRECT_COLOR visual for the pixmap * \returns new XMesaBuffer or NULL if error */ -XMesaBuffer +PUBLIC XMesaBuffer XMesaCreatePixmapBuffer(XMesaVisual v, XMesaPixmap p, XMesaColormap cmap) { int client = 0; @@ -1802,7 +1806,7 @@ XMesaCreatePBuffer(XMesaVisual v, XMesaColormap cmap, /* * Deallocate an XMesaBuffer structure and all related info. */ -void +PUBLIC void XMesaDestroyBuffer(XMesaBuffer b) { xmesa_free_buffer(b); @@ -1845,6 +1849,7 @@ GLboolean XMesaMakeCurrent( XMesaContext c, XMesaBuffer b ) /* * Bind buffer b to context c and make c the current rendering context. */ +PUBLIC GLboolean XMesaMakeCurrent2( XMesaContext c, XMesaBuffer drawBuffer, XMesaBuffer readBuffer ) { @@ -1958,6 +1963,8 @@ XMesaBuffer XMesaGetCurrentReadBuffer( void ) } +#ifdef XFree86Server +PUBLIC GLboolean XMesaForceCurrent(XMesaContext c) { if (c) { @@ -1976,6 +1983,7 @@ GLboolean XMesaForceCurrent(XMesaContext c) } +PUBLIC GLboolean XMesaLoseCurrent(XMesaContext c) { (void) c; @@ -1984,11 +1992,13 @@ GLboolean XMesaLoseCurrent(XMesaContext c) } +PUBLIC GLboolean XMesaCopyContext( XMesaContext xm_src, XMesaContext xm_dst, GLuint mask ) { _mesa_copy_context(&xm_src->mesa, &xm_dst->mesa, mask); return GL_TRUE; } +#endif /* XFree86Server */ /* @@ -2135,6 +2145,7 @@ static void FXgetImage( XMesaBuffer b ) * Copy the back buffer to the front buffer. If there's no back buffer * this is a no-op. */ +PUBLIC void XMesaSwapBuffers( XMesaBuffer b ) { GET_CURRENT_CONTEXT(ctx); @@ -2475,7 +2486,7 @@ unsigned long XMesaDitherColor( XMesaContext xmesa, GLint x, GLint y, * This is typically called when the window size changes and we need * to reallocate the buffer's back/depth/stencil/accum buffers. */ -void +PUBLIC void XMesaResizeBuffers( XMesaBuffer b ) { GET_CURRENT_CONTEXT(ctx); diff --git a/src/mesa/drivers/x11/xmesaP.h b/src/mesa/drivers/x11/xmesaP.h index bd5dce1..98d03cc 100644 --- a/src/mesa/drivers/x11/xmesaP.h +++ b/src/mesa/drivers/x11/xmesaP.h @@ -573,16 +573,6 @@ extern XMesaBuffer XMesaCreateWindowBuffer2( XMesaVisual v, XMesaWindow w, XMesaContext c ); -/* - * These are the extra routines required for integration with XFree86. - * None of these routines should be user visible. -KEM - */ -extern GLboolean XMesaForceCurrent(XMesaContext c); -extern GLboolean XMesaLoseCurrent(XMesaContext c); -extern GLboolean XMesaCopyContext( XMesaContext src, - XMesaContext dst, - GLuint mask ); - #define ENABLE_EXT_texure_compression_s3tc 0 /* SW texture compression */