-/* $Id: s_bitmap.c,v 1.1 2000/10/31 18:00:04 keithw Exp $ */
+/* $Id: s_bitmap.c,v 1.5 2001/03/03 20:33:30 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.3
+ * Version: 3.5
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 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"),
#include "macros.h"
#include "pixel.h"
+#include "s_context.h"
#include "s_fog.h"
#include "s_pb.h"
const struct gl_pixelstore_attrib *unpack,
const GLubyte *bitmap )
{
- struct pixel_buffer *PB = ctx->PB;
+ struct pixel_buffer *PB = SWRAST_CONTEXT(ctx)->PB;
GLint row, col;
GLdepth fragZ;
GLfixed fogCoord;
ASSERT(ctx->RenderMode == GL_RENDER);
ASSERT(bitmap);
- if (ctx->PB->primitive != GL_BITMAP) {
- gl_flush_pb( ctx );
- ctx->PB->primitive = GL_BITMAP;
- }
+ if (SWRAST_CONTEXT(ctx)->NewState)
+ _swrast_validate_derived( ctx );
/* Set bitmap drawing color */
- if (ctx->Visual.RGBAflag) {
+ if (ctx->Visual.rgbMode) {
GLint r, g, b, a;
r = (GLint) (ctx->Current.RasterColor[0] * CHAN_MAXF);
g = (GLint) (ctx->Current.RasterColor[1] * CHAN_MAXF);
PB_SET_INDEX( PB, ctx->Current.RasterIndex );
}
- fragZ = (GLdepth) ( ctx->Current.RasterPos[2] * ctx->Visual.DepthMaxF);
+ fragZ = (GLdepth) ( ctx->Current.RasterPos[2] * ctx->DepthMaxF);
_mesa_win_fog_coords_from_z( ctx, 1, &fragZ, &fogCoord );
}
}
- gl_flush_pb(ctx);
+ _mesa_flush_pb(ctx);
}