summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/Makefile.X113
-rw-r--r--src/mesa/main/accum.c8
-rw-r--r--src/mesa/main/attrib.c4
-rw-r--r--src/mesa/main/buffers.c55
-rw-r--r--src/mesa/main/clip.c4
-rw-r--r--src/mesa/main/config.h10
-rw-r--r--src/mesa/main/context.c209
-rw-r--r--src/mesa/main/context.h58
-rw-r--r--src/mesa/main/depth.c30
-rw-r--r--src/mesa/main/dlist.c4
-rw-r--r--src/mesa/main/drawpix.c30
-rw-r--r--src/mesa/main/enable.c18
-rw-r--r--src/mesa/main/feedback.c18
-rw-r--r--src/mesa/main/fog.c4
-rw-r--r--src/mesa/main/get.c122
-rw-r--r--src/mesa/main/glheader.h8
-rw-r--r--src/mesa/main/image.c8
-rw-r--r--src/mesa/main/imports.c163
-rw-r--r--src/mesa/main/imports.h39
-rw-r--r--src/mesa/main/light.c4
-rw-r--r--src/mesa/main/lines.c4
-rw-r--r--src/mesa/main/matrix.c10
-rw-r--r--src/mesa/main/points.c4
-rw-r--r--src/mesa/main/polygon.c6
-rw-r--r--src/mesa/main/rastpos.c8
-rw-r--r--src/mesa/main/state.c8
-rw-r--r--src/mesa/main/stencil.c4
27 files changed, 529 insertions, 314 deletions
diff --git a/src/mesa/main/Makefile.X11 b/src/mesa/main/Makefile.X11
index d4b1b5ba929..f3f97af3031 100644
--- a/src/mesa/main/Makefile.X11
+++ b/src/mesa/main/Makefile.X11
@@ -1,4 +1,4 @@
-# $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
@@ -55,6 +55,7 @@ CORE_SOURCES = \
hint.c \
image.c \
imaging.c \
+ imports.c \
light.c \
lines.c \
logic.c \
diff --git a/src/mesa/main/accum.c b/src/mesa/main/accum.c
index 35394181502..aeb6743c2fe 100644
--- a/src/mesa/main/accum.c
+++ b/src/mesa/main/accum.c
@@ -1,4 +1,4 @@
-/* $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
@@ -146,13 +146,13 @@ _mesa_Accum( GLenum op, GLfloat value )
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;
}
@@ -430,7 +430,7 @@ _mesa_clear_accum_buffer( GLcontext *ctx )
GLuint buffersize;
GLfloat acc_scale;
- if (ctx->Visual->AccumRedBits==0) {
+ if (ctx->Visual.AccumRedBits==0) {
/* No accumulation buffer! */
return;
}
diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
index 8c40063c135..b3c36435134 100644
--- a/src/mesa/main/attrib.c
+++ b/src/mesa/main/attrib.c
@@ -1,4 +1,4 @@
-/* $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
@@ -445,7 +445,7 @@ _mesa_PopAttrib(void)
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);
diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c
index c53dd137049..dfa8a77d345 100644
--- a/src/mesa/main/buffers.c
+++ b/src/mesa/main/buffers.c
@@ -1,4 +1,4 @@
-/* $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
@@ -51,7 +51,7 @@ _mesa_ClearIndex( GLfloat c )
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 );
}
@@ -71,7 +71,7 @@ _mesa_ClearColor( GLclampf red, GLclampf green,
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);
@@ -94,7 +94,7 @@ clear_color_buffer_with_masking( GLcontext *ctx )
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);
@@ -145,7 +145,7 @@ clear_color_buffer(GLcontext *ctx)
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);
@@ -170,7 +170,7 @@ clear_color_buffer(GLcontext *ctx)
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;
@@ -331,64 +331,63 @@ _mesa_DrawBuffer( GLenum mode )
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;
@@ -399,7 +398,7 @@ _mesa_DrawBuffer( GLenum mode )
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;
@@ -416,13 +415,13 @@ _mesa_DrawBuffer( GLenum mode )
/*
* 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;
@@ -492,7 +491,7 @@ _mesa_ReadBuffer( GLenum 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;
}
@@ -500,14 +499,14 @@ _mesa_ReadBuffer( GLenum mode )
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;
}
@@ -529,7 +528,7 @@ _mesa_ReadBuffer( GLenum mode )
void
_mesa_ResizeBuffersMESA( void )
{
- GLcontext *ctx = gl_get_current_context();
+ GLcontext *ctx = _mesa_get_current_context();
GLuint buf_width, buf_height;
diff --git a/src/mesa/main/clip.c b/src/mesa/main/clip.c
index d3d1395d26c..5d589f7638c 100644
--- a/src/mesa/main/clip.c
+++ b/src/mesa/main/clip.c
@@ -1,4 +1,4 @@
-/* $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
@@ -375,7 +375,7 @@ void gl_update_clipmask( GLcontext *ctx )
{
GLuint mask = 0;
- if (ctx->Visual->RGBAflag)
+ if (ctx->Visual.RGBAflag)
{
mask |= CLIP_RGBA0;
diff --git a/src/mesa/main/config.h b/src/mesa/main/config.h
index e19dce2276f..562040d431a 100644
--- a/src/mesa/main/config.h
+++ b/src/mesa/main/config.h
@@ -1,4 +1,4 @@
-/* $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
@@ -140,7 +140,7 @@
/*
* 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
@@ -194,13 +194,13 @@
#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
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 551327254f3..a66bb13972f 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -1,4 +1,4 @@
-/* $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
@@ -29,23 +29,21 @@
#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"
@@ -55,31 +53,94 @@
#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 *****/
/**********************************************************************/
@@ -138,7 +199,7 @@ _mesa_create_visual( GLboolean rgbFlag,
indexBits, depthBits, stencilBits,
accumRedBits, accumGreenBits,
accumBlueBits, accumAlphaBits,
- numSamples )) {
+ numSamples)) {
FREE(vis);
return NULL;
}
@@ -238,29 +299,6 @@ _mesa_initialize_visual( GLvisual *vis,
}
-/* 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 )
{
@@ -268,15 +306,6 @@ _mesa_destroy_visual( GLvisual *vis )
}
-/* obsolete */
-void
-gl_destroy_visual( GLvisual *vis )
-{
- _mesa_destroy_visual(vis);
-}
-
-
-
/**********************************************************************/
/***** GL Framebuffer allocation/destruction *****/
/**********************************************************************/
@@ -295,11 +324,11 @@ gl_destroy_visual( GLvisual *vis )
* 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);
@@ -314,7 +343,7 @@ gl_create_framebuffer( GLvisual *visual,
/*
* Initialize a GLframebuffer object.
- * Input: See gl_create_framebuffer() above.
+ * Input: See _mesa_create_framebuffer() above.
*/
void
_mesa_initialize_framebuffer( GLframebuffer *buffer,
@@ -357,7 +386,7 @@ _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) {
@@ -969,8 +998,6 @@ init_attrib_groups( GLcontext *ctx )
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 );
@@ -1179,8 +1206,8 @@ init_attrib_groups( GLcontext *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
@@ -1379,7 +1406,6 @@ alloc_proxy_textures( GLcontext *ctx )
}
-
/*
* Initialize a GLcontext struct. This includes allocating all the
* other structs and arrays which hang off of the context by pointers.
@@ -1398,8 +1424,16 @@ _mesa_initialize_context( GLcontext *ctx,
/* 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;
@@ -1533,13 +1567,13 @@ _mesa_initialize_context( GLcontext *ctx,
* 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) {
@@ -1562,14 +1596,14 @@ gl_create_context( GLvisual *visual,
* 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 );
@@ -1675,10 +1709,10 @@ gl_free_context_data( GLcontext *ctx )
* 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 );
}
}
@@ -1690,7 +1724,7 @@ gl_destroy_context( GLcontext *ctx )
* initialized. Currently just reads the config file.
*/
void
-gl_context_initialize( GLcontext *ctx )
+_mesa_context_initialize( GLcontext *ctx )
{
gl_read_config_file( ctx );
}
@@ -1704,7 +1738,7 @@ gl_context_initialize( GLcontext *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) );
@@ -1779,9 +1813,10 @@ gl_copy_context( const GLcontext *src, GLcontext *dst, GLuint mask )
/*
* 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 );
}
@@ -1789,8 +1824,9 @@ void gl_make_current( GLcontext *newCtx, GLframebuffer *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();
@@ -1798,7 +1834,7 @@ void gl_make_current2( GLcontext *newCtx, GLframebuffer *drawBuffer,
/* 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) {
@@ -1816,7 +1852,7 @@ void gl_make_current2( GLcontext *newCtx, GLframebuffer *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);
@@ -1825,7 +1861,7 @@ void gl_make_current2( GLcontext *newCtx, GLframebuffer *drawBuffer,
_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??? */
@@ -1868,7 +1904,8 @@ void gl_make_current2( GLcontext *newCtx, GLframebuffer *drawBuffer,
* 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();
}
@@ -1923,23 +1960,10 @@ void gl_problem( const GLcontext *ctx, const char *s )
* 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);
}
@@ -1947,7 +1971,8 @@ void gl_warning( const GLcontext *ctx, const 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 );
diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h
index 284f15e078e..8345f9e70fc 100644
--- a/src/mesa/main/context.h
+++ b/src/mesa/main/context.h
@@ -1,4 +1,4 @@
-/* $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
@@ -92,27 +92,9 @@ _mesa_initialize_visual( GLvisual *v,
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 );
-
/*
@@ -121,11 +103,11 @@ _mesa_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,
@@ -136,7 +118,7 @@ _mesa_initialize_framebuffer( GLframebuffer *fb,
GLboolean softwareAlpha );
extern void
-gl_destroy_framebuffer( GLframebuffer *buffer );
+_mesa_destroy_framebuffer( GLframebuffer *buffer );
@@ -145,10 +127,10 @@ gl_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,
@@ -158,31 +140,31 @@ _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);
@@ -235,13 +217,13 @@ extern 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 );
diff --git a/src/mesa/main/depth.c b/src/mesa/main/depth.c
index fc37c29c1c3..5f113447e7f 100644
--- a/src/mesa/main/depth.c
+++ b/src/mesa/main/depth.c
@@ -1,4 +1,4 @@
-/* $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
@@ -134,7 +134,7 @@ _mesa_DepthMask( GLboolean flag )
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;
@@ -641,7 +641,7 @@ _mesa_depth_test_span( GLcontext *ctx, GLuint n, GLint x, GLint y,
}
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;
@@ -1401,7 +1401,7 @@ _mesa_depth_test_pixels( GLcontext *ctx,
}
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);
@@ -1456,7 +1456,7 @@ _mesa_read_depth_span( GLcontext *ctx,
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++) {
@@ -1496,7 +1496,7 @@ void
_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) {
@@ -1528,7 +1528,7 @@ _mesa_read_depth_span_float( GLcontext *ctx,
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++) {
@@ -1585,7 +1585,7 @@ _mesa_alloc_depth_buffer( GLcontext *ctx )
}
/* 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);
@@ -1614,7 +1614,7 @@ _mesa_alloc_depth_buffer( GLcontext *ctx )
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 */
@@ -1627,8 +1627,8 @@ _mesa_clear_depth_buffer( GLcontext *ctx )
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
@@ -1642,7 +1642,7 @@ _mesa_clear_depth_buffer( GLcontext *ctx )
}
}
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
@@ -1658,8 +1658,8 @@ _mesa_clear_depth_buffer( GLcontext *ctx )
}
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,
@@ -1694,7 +1694,7 @@ _mesa_clear_depth_buffer( GLcontext *ctx )
}
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));
diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index e96ed862ac8..bb69c189c92 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -1,4 +1,4 @@
-/* $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
@@ -2552,7 +2552,7 @@ static void save_PolygonOffset( GLfloat factor, GLfloat units )
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);
}
diff --git a/src/mesa/main/drawpix.c b/src/mesa/main/drawpix.c
index bfc4a59aa42..52e27fe5da9 100644
--- a/src/mesa/main/drawpix.c
+++ b/src/mesa/main/drawpix.c
@@ -1,4 +1,4 @@
-/* $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
@@ -202,7 +202,7 @@ fast_draw_pixels(GLcontext *ctx, GLint x, GLint y,
}
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++)
@@ -222,7 +222,7 @@ fast_draw_pixels(GLcontext *ctx, GLint x, GLint y,
*/
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) {
@@ -259,7 +259,7 @@ fast_draw_pixels(GLcontext *ctx, GLint x, GLint y,
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) {
@@ -295,7 +295,7 @@ fast_draw_pixels(GLcontext *ctx, GLint x, GLint y,
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) {
@@ -353,7 +353,7 @@ fast_draw_pixels(GLcontext *ctx, GLint x, GLint y,
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) {
@@ -418,7 +418,7 @@ fast_draw_pixels(GLcontext *ctx, GLint x, GLint y,
}
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 */
@@ -510,7 +510,7 @@ draw_index_pixels( GLcontext *ctx, GLint x, GLint y,
/* 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;
@@ -620,7 +620,7 @@ draw_depth_pixels( GLcontext *ctx, GLint x, GLint y,
}
/* 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);
@@ -641,7 +641,7 @@ draw_depth_pixels( GLcontext *ctx, GLint x, GLint y,
}
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++) {
@@ -654,8 +654,8 @@ draw_depth_pixels( GLcontext *ctx, GLint x, GLint 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++) {
@@ -673,7 +673,7 @@ draw_depth_pixels( GLcontext *ctx, GLint x, GLint 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);
@@ -725,7 +725,7 @@ draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y,
/* 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;
@@ -892,7 +892,7 @@ _mesa_DrawPixels( GLsizei width, GLsizei height,
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);
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index 731bbe72dd9..67cf170689d 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -1,4 +1,4 @@
-/* $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
@@ -128,8 +128,8 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
}
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) {
@@ -342,8 +342,8 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean 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) {
@@ -353,7 +353,7 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean 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];
@@ -369,7 +369,7 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
}
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];
@@ -385,7 +385,7 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
}
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];
@@ -524,7 +524,7 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
/* 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];
diff --git a/src/mesa/main/feedback.c b/src/mesa/main/feedback.c
index af082369896..9f0063476d5 100644
--- a/src/mesa/main/feedback.c
+++ b/src/mesa/main/feedback.c
@@ -1,4 +1,4 @@
-/* $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
@@ -80,18 +80,18 @@ _mesa_FeedbackBuffer( GLsizei size, GLenum type, GLfloat *buffer )
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;
@@ -168,7 +168,7 @@ static void feedback_vertex( GLcontext *ctx, GLuint v, GLuint pv )
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)
@@ -302,7 +302,7 @@ void gl_select_triangle( GLcontext *ctx,
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 );
@@ -314,7 +314,7 @@ void gl_select_line( GLcontext *ctx,
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 );
}
@@ -323,7 +323,7 @@ void gl_select_line( GLcontext *ctx,
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++) {
@@ -479,7 +479,7 @@ _mesa_RenderMode( GLenum mode )
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;
}
diff --git a/src/mesa/main/fog.c b/src/mesa/main/fog.c
index 3479b3bd000..d547bf747f3 100644
--- a/src/mesa/main/fog.c
+++ b/src/mesa/main/fog.c
@@ -1,4 +1,4 @@
-/* $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
@@ -183,7 +183,7 @@ _mesa_fog_vertices( struct vertex_buffer *VB )
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 );
diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index 69deced9153..d10beda7787 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -1,4 +1,4 @@
-/* $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
@@ -104,16 +104,16 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
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]);
@@ -125,7 +125,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
*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);
@@ -182,7 +182,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
*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);
@@ -276,7 +276,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
*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);
@@ -301,7 +301,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
*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);
@@ -349,7 +349,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
*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);
@@ -364,13 +364,13 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
}
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);
@@ -729,7 +729,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
*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);
@@ -738,7 +738,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
*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);
@@ -759,7 +759,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
*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);
@@ -789,7 +789,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
*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);
@@ -1259,16 +1259,16 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
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];
@@ -1280,7 +1280,7 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
*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;
@@ -1337,7 +1337,7 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
*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;
@@ -1431,7 +1431,7 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
*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;
@@ -1456,7 +1456,7 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
*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);
@@ -1504,7 +1504,7 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
*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;
@@ -1519,13 +1519,13 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
}
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;
@@ -1884,7 +1884,7 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
*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;
@@ -1893,7 +1893,7 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
*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;
@@ -1914,7 +1914,7 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
*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;
@@ -1944,7 +1944,7 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
*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;
@@ -2414,16 +2414,16 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
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];
@@ -2435,7 +2435,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
*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;
@@ -2492,7 +2492,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
*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;
@@ -2583,7 +2583,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
*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;
@@ -2608,7 +2608,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
*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);
@@ -2656,7 +2656,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
*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;
@@ -2671,13 +2671,13 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
}
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;
@@ -3038,7 +3038,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
*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;
@@ -3047,7 +3047,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
*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;
@@ -3068,7 +3068,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
*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;
@@ -3098,7 +3098,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
*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;
@@ -3541,16 +3541,16 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
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] );
@@ -3562,7 +3562,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
*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;
@@ -3619,7 +3619,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
*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;
@@ -3714,7 +3714,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
*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;
@@ -3739,7 +3739,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
*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;
@@ -3787,7 +3787,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
*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;
@@ -3802,13 +3802,13 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
}
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;
@@ -4167,7 +4167,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
*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;
@@ -4176,7 +4176,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
*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;
@@ -4197,7 +4197,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
*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;
@@ -4227,7 +4227,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
*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;
diff --git a/src/mesa/main/glheader.h b/src/mesa/main/glheader.h
index ab5cb2e4775..f98e9885bb9 100644
--- a/src/mesa/main/glheader.h
+++ b/src/mesa/main/glheader.h
@@ -1,4 +1,4 @@
-/* $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
@@ -174,6 +174,12 @@ typedef struct tagPIXELFORMATDESCRIPTOR PIXELFORMATDESCRIPTOR, *PPIXELFORMATDESC
#include "GL/glext.h"
+#ifndef CAPI
+#define CAPI
+#endif
+#include "glcore.h"
+
+
/* Disable unreachable code warnings for Watcom C++ */
#ifdef __WATCOMC__
diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c
index 2d4f3014e21..99cbcfa8625 100644
--- a/src/mesa/main/image.c
+++ b/src/mesa/main/image.c
@@ -1,4 +1,4 @@
-/* $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
@@ -2301,7 +2301,7 @@ _mesa_unpack_ubyte_color_span( GLcontext *ctx,
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) {
@@ -2608,7 +2608,7 @@ _mesa_unpack_float_color_span( GLcontext *ctx,
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 */
{
@@ -3103,7 +3103,7 @@ _mesa_unpack_depth_span( const GLcontext *ctx, GLuint n, GLdepth *dest,
/* 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);
diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c
new file mode 100644
index 00000000000..c8f50dc12fe
--- /dev/null
+++ b/src/mesa/main/imports.c
@@ -0,0 +1,163 @@
+/* $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;
+}
diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h
new file mode 100644
index 00000000000..6153ce117da
--- /dev/null
+++ b/src/mesa/main/imports.h
@@ -0,0 +1,39 @@
+/* $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
diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c
index eb5c83135e3..e9e19f9d536 100644
--- a/src/mesa/main/light.c
+++ b/src/mesa/main/light.c
@@ -1,4 +1,4 @@
-/* $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
@@ -1268,7 +1268,7 @@ gl_update_lighting( GLcontext *ctx )
/* 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++) {
diff --git a/src/mesa/main/lines.c b/src/mesa/main/lines.c
index 991cbd06682..191110e3f87 100644
--- a/src/mesa/main/lines.c
+++ b/src/mesa/main/lines.c
@@ -1,4 +1,4 @@
-/* $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
@@ -1070,7 +1070,7 @@ _mesa_print_line_function(GLcontext *ctx)
*/
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) {
diff --git a/src/mesa/main/matrix.c b/src/mesa/main/matrix.c
index 52c48dd32bf..2d9d857a2f9 100644
--- a/src/mesa/main/matrix.c
+++ b/src/mesa/main/matrix.c
@@ -1,4 +1,4 @@
-/* $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
@@ -1559,8 +1559,8 @@ gl_Viewport( GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height )
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;
@@ -1617,8 +1617,8 @@ _mesa_DepthRange( GLclampd nearval, GLclampd farval )
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;
diff --git a/src/mesa/main/points.c b/src/mesa/main/points.c
index 519e1d96f0f..b8682be1e49 100644
--- a/src/mesa/main/points.c
+++ b/src/mesa/main/points.c
@@ -1,4 +1,4 @@
-/* $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
@@ -1332,7 +1332,7 @@ _mesa_print_points_function(GLcontext *ctx)
*/
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) {
diff --git a/src/mesa/main/polygon.c b/src/mesa/main/polygon.c
index 13f0a50c862..5ca3ffbc945 100644
--- a/src/mesa/main/polygon.c
+++ b/src/mesa/main/polygon.c
@@ -1,8 +1,8 @@
-/* $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.
*
@@ -187,5 +187,5 @@ _mesa_PolygonOffsetEXT( GLfloat factor, GLfloat bias )
{
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 );
}
diff --git a/src/mesa/main/rastpos.c b/src/mesa/main/rastpos.c
index 722431a948b..da0ccee7e9d 100644
--- a/src/mesa/main/rastpos.c
+++ b/src/mesa/main/rastpos.c
@@ -1,8 +1,8 @@
-/* $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.
*
@@ -90,7 +90,7 @@ static void raster_pos4f( GLcontext *ctx,
}
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);
}
@@ -132,7 +132,7 @@ static void raster_pos4f( GLcontext *ctx,
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;
diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c
index dcc3bd1b6e3..3578d28f899 100644
--- a/src/mesa/main/state.c
+++ b/src/mesa/main/state.c
@@ -1,4 +1,4 @@
-/* $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
@@ -705,7 +705,7 @@ static void update_rasterflags( GLcontext *ctx )
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;
@@ -746,12 +746,12 @@ static void update_rasterflags( GLcontext *ctx )
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;
diff --git a/src/mesa/main/stencil.c b/src/mesa/main/stencil.c
index f9cd4909df6..bc14fed08da 100644
--- a/src/mesa/main/stencil.c
+++ b/src/mesa/main/stencil.c
@@ -1,4 +1,4 @@
-/* $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
@@ -1268,7 +1268,7 @@ _mesa_alloc_stencil_buffer( GLcontext *ctx )
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;
}