63 if (
ctx->Buffer->Accum) {
69 n =
ctx->Buffer->Width *
ctx->Buffer->Height * 4 *
sizeof(
GLaccum);
71 if (!
ctx->Buffer->Accum) {
105 if (
ctx->Visual->AccumBits==0 || !
ctx->Buffer->Accum) {
107 gl_warning(
ctx,
"Calling glAccum() without an accumulation buffer");
123 if (
ctx->Scissor.Enabled) {
124 xpos =
ctx->Scissor.X;
125 ypos =
ctx->Scissor.Y;
145 acc =
ctx->Buffer->Accum
146 + (ypos *
ctx->Buffer->Width + xpos) * 4;
163 acc =
ctx->Buffer->Accum
164 + (ypos *
ctx->Buffer->Width + xpos) * 4;
180 GLfloat rscale, gscale, bscale, ascale;
183 (
void) (*
ctx->Driver.SetBuffer)(
ctx,
ctx->Pixel.ReadBuffer );
186 rscale =
value * acc_scale *
ctx->Visual->InvRedScale;
187 gscale =
value * acc_scale *
ctx->Visual->InvGreenScale;
188 bscale =
value * acc_scale *
ctx->Visual->InvBlueScale;
189 ascale =
value * acc_scale *
ctx->Visual->InvAlphaScale;
191 (*
ctx->Driver.ReadColorSpan)(
ctx,
width, xpos, ypos,
193 acc =
ctx->Buffer->Accum
194 + (ypos *
ctx->Buffer->Width + xpos) * 4;
204 (
void) (*
ctx->Driver.SetBuffer)(
ctx,
ctx->Color.DrawBuffer );
212 GLfloat rscale, gscale, bscale, ascale;
215 (
void) (*
ctx->Driver.SetBuffer)(
ctx,
ctx->Pixel.ReadBuffer );
218 rscale =
value * acc_scale *
ctx->Visual->InvRedScale;
219 gscale =
value * acc_scale *
ctx->Visual->InvGreenScale;
220 bscale =
value * acc_scale *
ctx->Visual->InvBlueScale;
221 ascale =
value * acc_scale *
ctx->Visual->InvAlphaScale;
223 (*
ctx->Driver.ReadColorSpan)(
ctx,
width, xpos, ypos,
225 acc =
ctx->Buffer->Accum
226 + (ypos *
ctx->Buffer->Width + xpos) * 4;
236 (
void) (*
ctx->Driver.SetBuffer)(
ctx,
ctx->Color.DrawBuffer );
244 GLfloat rscale, gscale, bscale, ascale;
245 GLint rmax, gmax, bmax, amax;
248 rscale =
value / acc_scale *
ctx->Visual->RedScale;
249 gscale =
value / acc_scale *
ctx->Visual->GreenScale;
250 bscale =
value / acc_scale *
ctx->Visual->BlueScale;
251 ascale =
value / acc_scale *
ctx->Visual->AlphaScale;
252 rmax = (
GLint)
ctx->Visual->RedScale;
253 gmax = (
GLint)
ctx->Visual->GreenScale;
254 bmax = (
GLint)
ctx->Visual->BlueScale;
255 amax = (
GLint)
ctx->Visual->AlphaScale;
257 acc =
ctx->Buffer->Accum
258 + (ypos *
ctx->Buffer->Width + xpos) * 4;
270 (*
ctx->Driver.WriteColorSpan)(
ctx,
width, xpos, ypos,
292 if (
ctx->Visual->AccumBits==0) {
309 buffersize =
ctx->Buffer->Width *
ctx->Buffer->Height;
311 if (!
ctx->Buffer->Accum) {
317 if (
ctx->Buffer->Accum) {
318 if (
ctx->Scissor.Enabled) {
324 r = (
GLaccum) (
ctx->Accum.ClearColor[0] * acc_scale);
325 g = (
GLaccum) (
ctx->Accum.ClearColor[1] * acc_scale);
326 b = (
GLaccum) (
ctx->Accum.ClearColor[2] * acc_scale);
327 a = (
GLaccum) (
ctx->Accum.ClearColor[3] * acc_scale);
329 width = 4 * (
ctx->Buffer->Xmax -
ctx->Buffer->Xmin + 1);
333 + 4 * (
ctx->Buffer->Ymin *
ctx->Buffer->Width
334 +
ctx->Buffer->Xmin);
342 row += 4 *
ctx->Buffer->Width;
347 if (
ctx->Accum.ClearColor[0]==0.0 &&
348 ctx->Accum.ClearColor[1]==0.0 &&
349 ctx->Accum.ClearColor[2]==0.0 &&
350 ctx->Accum.ClearColor[3]==0.0) {
359 acc =
ctx->Buffer->Accum;
360 r = (
GLaccum) (
ctx->Accum.ClearColor[0] * acc_scale);
361 g = (
GLaccum) (
ctx->Accum.ClearColor[1] * acc_scale);
362 b = (
GLaccum) (
ctx->Accum.ClearColor[2] * acc_scale);
363 a = (
GLaccum) (
ctx->Accum.ClearColor[3] * acc_scale);
364 for (
i=0;
i<buffersize;
i++) {
void gl_ClearAccum(GLcontext *ctx, GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
void gl_alloc_accum_buffer(GLcontext *ctx)
void gl_Accum(GLcontext *ctx, GLenum op, GLfloat value)
void gl_clear_accum_buffer(GLcontext *ctx)
void gl_warning(const GLcontext *ctx, const char *s)
void gl_error(GLcontext *ctx, GLenum error, const char *s)
struct png_info_def *typedef unsigned char **typedef struct png_info_def *typedef struct png_info_def *typedef struct png_info_def *typedef unsigned char ** row
#define GL_INVALID_OPERATION
GLclampf GLclampf GLclampf alpha
GLint GLint GLsizei GLsizei height
GLdouble GLdouble GLdouble r
GLint GLint GLsizei width
GLboolean GLboolean GLboolean b
GLboolean GLboolean GLboolean GLboolean a
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
#define MEMSET(DST, VAL, N)
#define INSIDE_BEGIN_END(CTX)
static float(__cdecl *square_half_float)(float x
#define CLAMP(f, min, max)