From b1394fa92aaaf859ce9efc8b5fc194397921320c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 26 Sep 2000 20:53:53 +0000 Subject: 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. --- src/mesa/main/drawpix.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src/mesa/main/drawpix.c') diff --git a/src/mesa/main/drawpix.c b/src/mesa/main/drawpix.c index bfc4a59aa4..52e27fe5da 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; iVisual->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;iVisual->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); -- cgit v1.2.3