-/* $Id: attrib.c,v 1.7 1999/10/11 04:20:55 joukj Exp $ */
+/* $Id: attrib.c,v 1.23 2000/05/07 20:41:30 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.1
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * 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"),
*/
-
-#include <stdlib.h>
-
#ifdef PC_HEADER
#include "all.h"
#else
-#ifndef XFree86Server
-#include <stdio.h>
-#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "attrib.h"
+#include "buffers.h"
#include "context.h"
-#include "glmisc.h"
#include "enable.h"
#include "enums.h"
-#include "macros.h"
+#include "mem.h"
#include "simple_list.h"
#include "texstate.h"
#include "types.h"
-#ifdef XFree86Server
-#undef MISC_H
-#include "GL/xf86glx.h"
-#endif
#endif
* Allocate a new attribute state node. These nodes have a
* "kind" value and a pointer to a struct of state data.
*/
-static struct gl_attrib_node *new_attrib_node( GLbitfield kind )
+static struct gl_attrib_node *
+new_attrib_node( GLbitfield kind )
{
- struct gl_attrib_node *an = GL_ALLOC_STRUCT(gl_attrib_node);
+ struct gl_attrib_node *an = MALLOC_STRUCT(gl_attrib_node);
if (an) {
an->kind = kind;
}
/*
* Copy texture object state from one texture object to another.
*/
-static void copy_texobj_state( struct gl_texture_object *dest,
- const struct gl_texture_object *src )
+static void
+copy_texobj_state( struct gl_texture_object *dest,
+ const struct gl_texture_object *src )
{
/*
dest->Name = src->Name;
dest->P = src->P;
dest->M = src->M;
dest->MinMagThresh = src->MinMagThresh;
- memcpy( dest->Palette, src->Palette,
- sizeof(GLubyte) * MAX_TEXTURE_PALETTE_SIZE * 4 );
- dest->PaletteSize = src->PaletteSize;
- dest->PaletteIntFormat = src->PaletteIntFormat;
- dest->PaletteFormat = src->PaletteFormat;
+ dest->Palette = src->Palette;
dest->Complete = src->Complete;
dest->SampleFunc = src->SampleFunc;
}
-void gl_PushAttrib( GLcontext* ctx, GLbitfield mask )
+void
+_mesa_PushAttrib(GLbitfield mask)
{
struct gl_attrib_node *newnode;
struct gl_attrib_node *head;
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPushAttrib");
if (MESA_VERBOSE&VERBOSE_API)
- fprintf(stderr, "glPushAttrib %x\n", mask);
+ fprintf(stderr, "glPushAttrib %x\n", (int)mask);
if (ctx->AttribStackDepth>=MAX_ATTRIB_STACK_DEPTH) {
gl_error( ctx, GL_STACK_OVERFLOW, "glPushAttrib" );
if (mask & GL_ACCUM_BUFFER_BIT) {
struct gl_accum_attrib *attr;
- attr = GL_ALLOC_STRUCT( gl_accum_attrib );
+ attr = MALLOC_STRUCT( gl_accum_attrib );
MEMCPY( attr, &ctx->Accum, sizeof(struct gl_accum_attrib) );
newnode = new_attrib_node( GL_ACCUM_BUFFER_BIT );
newnode->data = attr;
if (mask & GL_COLOR_BUFFER_BIT) {
struct gl_colorbuffer_attrib *attr;
- attr = GL_ALLOC_STRUCT( gl_colorbuffer_attrib );
+ attr = MALLOC_STRUCT( gl_colorbuffer_attrib );
MEMCPY( attr, &ctx->Color, sizeof(struct gl_colorbuffer_attrib) );
newnode = new_attrib_node( GL_COLOR_BUFFER_BIT );
newnode->data = attr;
if (mask & GL_CURRENT_BIT) {
struct gl_current_attrib *attr;
- attr = GL_ALLOC_STRUCT( gl_current_attrib );
+ attr = MALLOC_STRUCT( gl_current_attrib );
MEMCPY( attr, &ctx->Current, sizeof(struct gl_current_attrib) );
newnode = new_attrib_node( GL_CURRENT_BIT );
newnode->data = attr;
if (mask & GL_DEPTH_BUFFER_BIT) {
struct gl_depthbuffer_attrib *attr;
- attr = GL_ALLOC_STRUCT( gl_depthbuffer_attrib );
+ attr = MALLOC_STRUCT( gl_depthbuffer_attrib );
MEMCPY( attr, &ctx->Depth, sizeof(struct gl_depthbuffer_attrib) );
newnode = new_attrib_node( GL_DEPTH_BUFFER_BIT );
newnode->data = attr;
if (mask & GL_ENABLE_BIT) {
struct gl_enable_attrib *attr;
GLuint i;
- attr = GL_ALLOC_STRUCT( gl_enable_attrib );
+ attr = MALLOC_STRUCT( gl_enable_attrib );
/* Copy enable flags from all other attributes into the enable struct. */
attr->AlphaTest = ctx->Color.AlphaEnabled;
attr->AutoNormal = ctx->Eval.AutoNormal;
attr->ClipPlane[i] = ctx->Transform.ClipEnabled[i];
}
attr->ColorMaterial = ctx->Light.ColorMaterialEnabled;
+ attr->Convolution1D = ctx->Pixel.Convolution1DEnabled;
+ attr->Convolution2D = ctx->Pixel.Convolution2DEnabled;
+ attr->Separable2D = ctx->Pixel.Separable2DEnabled;
attr->CullFace = ctx->Polygon.CullFlag;
attr->DepthTest = ctx->Depth.Test;
attr->Dither = ctx->Color.DitherFlag;
attr->Lighting = ctx->Light.Enabled;
attr->LineSmooth = ctx->Line.SmoothFlag;
attr->LineStipple = ctx->Line.StippleFlag;
+ attr->Histogram = ctx->Pixel.HistogramEnabled;
+ attr->MinMax = ctx->Pixel.MinMaxEnabled;
attr->IndexLogicOp = ctx->Color.IndexLogicOpEnabled;
attr->ColorLogicOp = ctx->Color.ColorLogicOpEnabled;
attr->Map1Color4 = ctx->Eval.Map1Color4;
attr->Map2Vertex3 = ctx->Eval.Map2Vertex3;
attr->Map2Vertex4 = ctx->Eval.Map2Vertex4;
attr->Normalize = ctx->Transform.Normalize;
+ attr->PixelTexture = ctx->Pixel.PixelTextureEnabled;
attr->PointSmooth = ctx->Point.SmoothFlag;
attr->PolygonOffsetPoint = ctx->Polygon.OffsetPoint;
attr->PolygonOffsetLine = ctx->Polygon.OffsetLine;
if (mask & GL_EVAL_BIT) {
struct gl_eval_attrib *attr;
- attr = GL_ALLOC_STRUCT( gl_eval_attrib );
+ attr = MALLOC_STRUCT( gl_eval_attrib );
MEMCPY( attr, &ctx->Eval, sizeof(struct gl_eval_attrib) );
newnode = new_attrib_node( GL_EVAL_BIT );
newnode->data = attr;
if (mask & GL_FOG_BIT) {
struct gl_fog_attrib *attr;
- attr = GL_ALLOC_STRUCT( gl_fog_attrib );
+ attr = MALLOC_STRUCT( gl_fog_attrib );
MEMCPY( attr, &ctx->Fog, sizeof(struct gl_fog_attrib) );
newnode = new_attrib_node( GL_FOG_BIT );
newnode->data = attr;
if (mask & GL_HINT_BIT) {
struct gl_hint_attrib *attr;
- attr = GL_ALLOC_STRUCT( gl_hint_attrib );
+ attr = MALLOC_STRUCT( gl_hint_attrib );
MEMCPY( attr, &ctx->Hint, sizeof(struct gl_hint_attrib) );
newnode = new_attrib_node( GL_HINT_BIT );
newnode->data = attr;
if (mask & GL_LIGHTING_BIT) {
struct gl_light_attrib *attr;
- attr = GL_ALLOC_STRUCT( gl_light_attrib );
+ attr = MALLOC_STRUCT( gl_light_attrib );
MEMCPY( attr, &ctx->Light, sizeof(struct gl_light_attrib) );
newnode = new_attrib_node( GL_LIGHTING_BIT );
newnode->data = attr;
if (mask & GL_LINE_BIT) {
struct gl_line_attrib *attr;
- attr = GL_ALLOC_STRUCT( gl_line_attrib );
+ attr = MALLOC_STRUCT( gl_line_attrib );
MEMCPY( attr, &ctx->Line, sizeof(struct gl_line_attrib) );
newnode = new_attrib_node( GL_LINE_BIT );
newnode->data = attr;
if (mask & GL_LIST_BIT) {
struct gl_list_attrib *attr;
- attr = GL_ALLOC_STRUCT( gl_list_attrib );
+ attr = MALLOC_STRUCT( gl_list_attrib );
MEMCPY( attr, &ctx->List, sizeof(struct gl_list_attrib) );
newnode = new_attrib_node( GL_LIST_BIT );
newnode->data = attr;
if (mask & GL_PIXEL_MODE_BIT) {
struct gl_pixel_attrib *attr;
- attr = GL_ALLOC_STRUCT( gl_pixel_attrib );
+ attr = MALLOC_STRUCT( gl_pixel_attrib );
MEMCPY( attr, &ctx->Pixel, sizeof(struct gl_pixel_attrib) );
newnode = new_attrib_node( GL_PIXEL_MODE_BIT );
newnode->data = attr;
if (mask & GL_POINT_BIT) {
struct gl_point_attrib *attr;
- attr = GL_ALLOC_STRUCT( gl_point_attrib );
+ attr = MALLOC_STRUCT( gl_point_attrib );
MEMCPY( attr, &ctx->Point, sizeof(struct gl_point_attrib) );
newnode = new_attrib_node( GL_POINT_BIT );
newnode->data = attr;
if (mask & GL_POLYGON_BIT) {
struct gl_polygon_attrib *attr;
- attr = GL_ALLOC_STRUCT( gl_polygon_attrib );
+ attr = MALLOC_STRUCT( gl_polygon_attrib );
MEMCPY( attr, &ctx->Polygon, sizeof(struct gl_polygon_attrib) );
newnode = new_attrib_node( GL_POLYGON_BIT );
newnode->data = attr;
if (mask & GL_POLYGON_STIPPLE_BIT) {
GLuint *stipple;
- stipple = (GLuint *) GL_ALLOC( 32*sizeof(GLuint) );
+ stipple = (GLuint *) MALLOC( 32*sizeof(GLuint) );
MEMCPY( stipple, ctx->PolygonStipple, 32*sizeof(GLuint) );
newnode = new_attrib_node( GL_POLYGON_STIPPLE_BIT );
newnode->data = stipple;
if (mask & GL_SCISSOR_BIT) {
struct gl_scissor_attrib *attr;
- attr = GL_ALLOC_STRUCT( gl_scissor_attrib );
+ attr = MALLOC_STRUCT( gl_scissor_attrib );
MEMCPY( attr, &ctx->Scissor, sizeof(struct gl_scissor_attrib) );
newnode = new_attrib_node( GL_SCISSOR_BIT );
newnode->data = attr;
if (mask & GL_STENCIL_BUFFER_BIT) {
struct gl_stencil_attrib *attr;
- attr = GL_ALLOC_STRUCT( gl_stencil_attrib );
+ attr = MALLOC_STRUCT( gl_stencil_attrib );
MEMCPY( attr, &ctx->Stencil, sizeof(struct gl_stencil_attrib) );
newnode = new_attrib_node( GL_STENCIL_BUFFER_BIT );
newnode->data = attr;
ctx->Texture.Unit[u].CurrentD[2]->RefCount++;
ctx->Texture.Unit[u].CurrentD[3]->RefCount++;
}
- attr = GL_ALLOC_STRUCT( gl_texture_attrib );
+ attr = MALLOC_STRUCT( gl_texture_attrib );
MEMCPY( attr, &ctx->Texture, sizeof(struct gl_texture_attrib) );
/* copy state of the currently bound texture objects */
for (u = 0; u < ctx->Const.MaxTextureUnits; u++) {
if (mask & GL_TRANSFORM_BIT) {
struct gl_transform_attrib *attr;
- attr = GL_ALLOC_STRUCT( gl_transform_attrib );
+ attr = MALLOC_STRUCT( gl_transform_attrib );
MEMCPY( attr, &ctx->Transform, sizeof(struct gl_transform_attrib) );
newnode = new_attrib_node( GL_TRANSFORM_BIT );
newnode->data = attr;
if (mask & GL_VIEWPORT_BIT) {
struct gl_viewport_attrib *attr;
- attr = GL_ALLOC_STRUCT( gl_viewport_attrib );
+ attr = MALLOC_STRUCT( gl_viewport_attrib );
MEMCPY( attr, &ctx->Viewport, sizeof(struct gl_viewport_attrib) );
newnode = new_attrib_node( GL_VIEWPORT_BIT );
newnode->data = attr;
* This function is kind of long just because we have to call a lot
* of device driver functions to update device driver state.
*/
-void gl_PopAttrib( GLcontext* ctx )
+void
+_mesa_PopAttrib(void)
{
struct gl_attrib_node *attr, *next;
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPopAttrib");
GLubyte oldAlphaRef = ctx->Color.AlphaRef;
GLenum oldBlendSrc = ctx->Color.BlendSrcRGB;
GLenum oldBlendDst = ctx->Color.BlendDstRGB;
+ GLenum oldLogicOp = ctx->Color.LogicOp;
MEMCPY( &ctx->Color, attr->data,
sizeof(struct gl_colorbuffer_attrib) );
if (ctx->Color.DrawBuffer != oldDrawBuffer) {
- gl_DrawBuffer(ctx, ctx->Color.DrawBuffer);
+ _mesa_DrawBuffer( ctx->Color.DrawBuffer);
}
- if ((ctx->Color.AlphaFunc != oldAlphaFunc ||
- ctx->Color.AlphaRef != oldAlphaRef) &&
- ctx->Driver.AlphaFunc)
- (*ctx->Driver.AlphaFunc)( ctx, ctx->Color.AlphaFunc,
- ctx->Color.AlphaRef / 255.0F);
if ((ctx->Color.BlendSrcRGB != oldBlendSrc ||
- ctx->Color.BlendSrcRGB != oldBlendDst) &&
+ ctx->Color.BlendDstRGB != oldBlendDst) &&
ctx->Driver.BlendFunc)
(*ctx->Driver.BlendFunc)( ctx, ctx->Color.BlendSrcRGB,
ctx->Color.BlendDstRGB);
+ if (ctx->Color.LogicOp != oldLogicOp &&
+ ctx->Driver.LogicOpcode) {
+ ctx->Driver.LogicOpcode( ctx, ctx->Color.LogicOp );
+ }
+ 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);
+ GLubyte a = (GLint) (ctx->Color.ClearColor[3] * 255.0F);
+ (*ctx->Driver.ClearColor)( ctx, r, g, b, a );
+ if ((ctx->Color.AlphaFunc != oldAlphaFunc ||
+ ctx->Color.AlphaRef != oldAlphaRef) &&
+ ctx->Driver.AlphaFunc)
+ (*ctx->Driver.AlphaFunc)( ctx, ctx->Color.AlphaFunc,
+ ctx->Color.AlphaRef / 255.0F);
+ if (ctx->Driver.ColorMask) {
+ (*ctx->Driver.ColorMask)(ctx,
+ ctx->Color.ColorMask[0],
+ ctx->Color.ColorMask[1],
+ ctx->Color.ColorMask[2],
+ ctx->Color.ColorMask[3]);
+ }
+ }
+ else {
+ (*ctx->Driver.ClearIndex)( ctx, ctx->Color.ClearIndex);
+ }
}
break;
case GL_CURRENT_BIT:
#define TEST_AND_UPDATE(VALUE, NEWVALUE, ENUM) \
if ((VALUE) != (NEWVALUE)) { \
- gl_set_enable( ctx, ENUM, (NEWVALUE) ); \
+ _mesa_set_enable( ctx, ENUM, (NEWVALUE) ); \
}
TEST_AND_UPDATE(ctx->Color.AlphaEnabled, enable->AlphaTest, GL_ALPHA_TEST);
GLuint i;
for (i=0;i<MAX_CLIP_PLANES;i++) {
if (ctx->Transform.ClipEnabled[i] != enable->ClipPlane[i])
- gl_set_enable( ctx, (GLenum) (GL_CLIP_PLANE0 + i), enable->ClipPlane[i] );
+ _mesa_set_enable( ctx, (GLenum) (GL_CLIP_PLANE0 + i), enable->ClipPlane[i] );
}
}
TEST_AND_UPDATE(ctx->Light.ColorMaterialEnabled, enable->ColorMaterial, GL_COLOR_MATERIAL);
TEST_AND_UPDATE(ctx->Polygon.CullFlag, enable->CullFace, GL_CULL_FACE);
TEST_AND_UPDATE(ctx->Depth.Test, enable->DepthTest, GL_DEPTH_TEST);
TEST_AND_UPDATE(ctx->Color.DitherFlag, enable->Dither, GL_DITHER);
+ TEST_AND_UPDATE(ctx->Pixel.Convolution1DEnabled, enable->Convolution1D, GL_CONVOLUTION_1D);
+ TEST_AND_UPDATE(ctx->Pixel.Convolution2DEnabled, enable->Convolution2D, GL_CONVOLUTION_2D);
+ TEST_AND_UPDATE(ctx->Pixel.Separable2DEnabled, enable->Separable2D, GL_SEPARABLE_2D);
TEST_AND_UPDATE(ctx->Fog.Enabled, enable->Fog, GL_FOG);
TEST_AND_UPDATE(ctx->Light.Enabled, enable->Lighting, GL_LIGHTING);
TEST_AND_UPDATE(ctx->Line.SmoothFlag, enable->LineSmooth, GL_LINE_SMOOTH);
TEST_AND_UPDATE(ctx->Eval.Map2Vertex4, enable->Map2Vertex4, GL_MAP2_VERTEX_4);
TEST_AND_UPDATE(ctx->Transform.Normalize, enable->Normalize, GL_NORMALIZE);
TEST_AND_UPDATE(ctx->Transform.RescaleNormals, enable->RescaleNormals, GL_RESCALE_NORMAL_EXT);
+ TEST_AND_UPDATE(ctx->Pixel.PixelTextureEnabled, enable->PixelTexture, GL_POINT_SMOOTH);
TEST_AND_UPDATE(ctx->Point.SmoothFlag, enable->PointSmooth, GL_POINT_SMOOTH);
TEST_AND_UPDATE(ctx->Polygon.OffsetPoint, enable->PolygonOffsetPoint, GL_POLYGON_OFFSET_POINT);
TEST_AND_UPDATE(ctx->Polygon.OffsetLine, enable->PolygonOffsetLine, GL_POLYGON_OFFSET_LINE);
break;
case GL_FOG_BIT:
{
- GLboolean anyChange = (memcmp( &ctx->Fog, attr->data, sizeof(struct gl_fog_attrib) ) != 0);
+ GLboolean anyChange = (GLboolean) (memcmp( &ctx->Fog, attr->data, sizeof(struct gl_fog_attrib) ) != 0);
MEMCPY( &ctx->Fog, attr->data, sizeof(struct gl_fog_attrib) );
if (anyChange && ctx->Driver.Fogfv) {
- const GLfloat mode = ctx->Fog.Mode;
+ const GLfloat mode = (GLfloat) ctx->Fog.Mode;
const GLfloat density = ctx->Fog.Density;
const GLfloat start = ctx->Fog.Start;
const GLfloat end = ctx->Fog.End;
(*ctx->Driver.Fogfv)( ctx, GL_FOG_INDEX, &index );
(*ctx->Driver.Fogfv)( ctx, GL_FOG_COLOR, ctx->Fog.Color );
}
- ctx->Enabled &= ENABLE_FOG;
+ ctx->Enabled &= ~ENABLE_FOG;
if (ctx->Fog.Enabled) ctx->Enabled |= ENABLE_FOG;
}
break;
}
(*ctx->Driver.Enable)( ctx, GL_LIGHTING, ctx->Light.Enabled );
}
- ctx->Enabled &= ENABLE_LIGHT;
+ if (ctx->Light.ShadeModel == GL_FLAT)
+ ctx->TriangleCaps |= DD_FLATSHADE;
+ else
+ ctx->TriangleCaps &= ~DD_FLATSHADE;
+ if (ctx->Driver.ShadeModel)
+ (*ctx->Driver.ShadeModel)(ctx, ctx->Light.ShadeModel);
+ ctx->Enabled &= ~ENABLE_LIGHT;
if (ctx->Light.Enabled && !is_empty_list(&ctx->Light.EnabledList))
ctx->Enabled |= ENABLE_LIGHT;
break;
(*ctx->Driver.Enable)( ctx, GL_LINE_SMOOTH, ctx->Line.SmoothFlag );
(*ctx->Driver.Enable)( ctx, GL_LINE_STIPPLE, ctx->Line.StippleFlag );
}
+ if (ctx->Driver.LineStipple)
+ (*ctx->Driver.LineStipple)(ctx, ctx->Line.StippleFactor,
+ ctx->Line.StipplePattern);
+ if (ctx->Driver.LineWidth)
+ (*ctx->Driver.LineWidth)(ctx, ctx->Line.Width);
break;
case GL_LIST_BIT:
MEMCPY( &ctx->List, attr->data, sizeof(struct gl_list_attrib) );
break;
case GL_POLYGON_STIPPLE_BIT:
MEMCPY( ctx->PolygonStipple, attr->data, 32*sizeof(GLuint) );
+ if (ctx->Driver.PolygonStipple)
+ ctx->Driver.PolygonStipple( ctx, (const GLubyte *) attr->data );
break;
case GL_SCISSOR_BIT:
MEMCPY( &ctx->Scissor, attr->data,
struct gl_viewport_attrib *v =
(struct gl_viewport_attrib *)attr->data;
- gl_Viewport( ctx, v->X, v->Y, v->Width, v->Height );
- gl_DepthRange( ctx, v->Near, v->Far );
+ _mesa_Viewport( v->X, v->Y, v->Width, v->Height );
+ _mesa_DepthRange( v->Near, v->Far );
break;
}
default:
}
next = attr->next;
- GL_FREE( attr->data );
- GL_FREE( attr );
+ FREE( attr->data );
+ FREE( attr );
attr = next;
}
#define GL_CLIENT_UNPACK_BIT (1<<21)
-void gl_PushClientAttrib( GLcontext *ctx, GLbitfield mask )
+void
+_mesa_PushClientAttrib(GLbitfield mask)
{
struct gl_attrib_node *newnode;
struct gl_attrib_node *head;
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPushClientAttrib");
if (ctx->ClientAttribStackDepth>=MAX_CLIENT_ATTRIB_STACK_DEPTH) {
if (mask & GL_CLIENT_PIXEL_STORE_BIT) {
struct gl_pixelstore_attrib *attr;
/* packing attribs */
- attr = GL_ALLOC_STRUCT( gl_pixelstore_attrib );
+ attr = MALLOC_STRUCT( gl_pixelstore_attrib );
MEMCPY( attr, &ctx->Pack, sizeof(struct gl_pixelstore_attrib) );
newnode = new_attrib_node( GL_CLIENT_PACK_BIT );
newnode->data = attr;
newnode->next = head;
head = newnode;
/* unpacking attribs */
- attr = GL_ALLOC_STRUCT( gl_pixelstore_attrib );
+ attr = MALLOC_STRUCT( gl_pixelstore_attrib );
MEMCPY( attr, &ctx->Unpack, sizeof(struct gl_pixelstore_attrib) );
newnode = new_attrib_node( GL_CLIENT_UNPACK_BIT );
newnode->data = attr;
}
if (mask & GL_CLIENT_VERTEX_ARRAY_BIT) {
struct gl_array_attrib *attr;
- attr = GL_ALLOC_STRUCT( gl_array_attrib );
+ attr = MALLOC_STRUCT( gl_array_attrib );
MEMCPY( attr, &ctx->Array, sizeof(struct gl_array_attrib) );
newnode = new_attrib_node( GL_CLIENT_VERTEX_ARRAY_BIT );
newnode->data = attr;
-void gl_PopClientAttrib( GLcontext *ctx )
+void
+_mesa_PopClientAttrib(void)
{
struct gl_attrib_node *attr, *next;
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPopClientAttrib");
if (ctx->ClientAttribStackDepth==0) {
}
next = attr->next;
- GL_FREE( attr->data );
- GL_FREE( attr );
+ FREE( attr->data );
+ FREE( attr );
attr = next;
}
ctx->NewState = NEW_ALL;
}
+
+