From 1e24d3318df57b36e3b68695ff64b4b8bd822c9e Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 1 Apr 2003 17:28:10 +0000 Subject: use structure containment to derive xmesa_context from GLcontext --- src/mesa/drivers/x11/xmesaP.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/mesa/drivers/x11/xmesaP.h') diff --git a/src/mesa/drivers/x11/xmesaP.h b/src/mesa/drivers/x11/xmesaP.h index 46886eb9c6..5024e527c2 100644 --- a/src/mesa/drivers/x11/xmesaP.h +++ b/src/mesa/drivers/x11/xmesaP.h @@ -1,4 +1,4 @@ -/* $Id: xmesaP.h,v 1.35 2003/02/25 19:26:30 brianp Exp $ */ +/* $Id: xmesaP.h,v 1.36 2003/04/01 17:28:12 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -137,7 +137,7 @@ struct xmesa_visual { * "Derived" from __GLcontextRec. Basically corresponds to a GLXContext. */ struct xmesa_context { - GLcontext *gl_ctx; /* the core library context */ + GLcontext mesa; /* the core library context (containment) */ XMesaVisual xm_visual; /* Describes the buffers */ XMesaBuffer xm_draw_buffer; /* current draw framebuffer */ XMesaBuffer xm_read_buffer; /* current read framebuffer */ @@ -494,6 +494,15 @@ static int const kernel1[16] = { + +/* + * Return pointer to XMesaContext corresponding to a Mesa GLcontext. + * Since we're using structure containment, it's just a cast!. + */ +#define XMESA_CONTEXT(MESACTX) (XMesaContext) (MESACTX) + + + /* * External functions: */ -- cgit v1.2.3