/** * Initialize the state associated with buffer objects */ void _mesa_init_buffer_objects( GLcontext *ctx ) { GLuint i; /* Allocate the default buffer object and set refcount so high that * it never gets deleted. */ ctx->Array.NullBufferObj = _mesa_new_buffer_object(ctx, 0, 0); if (ctx->Array.NullBufferObj) ctx->Array.NullBufferObj->RefCount = 1000; ctx->Array.ArrayBufferObj = ctx->Array.NullBufferObj; ctx->Array.ElementArrayBufferObj = ctx->Array.NullBufferObj; /* Vertex array buffers */ ctx->Array.Vertex.BufferObj = ctx->Array.NullBufferObj; ctx->Array.Normal.BufferObj = ctx->Array.NullBufferObj; ctx->Array.Color.BufferObj = ctx->Array.NullBufferObj; ctx->Array.SecondaryColor.BufferObj = ctx->Array.NullBufferObj; ctx->Array.FogCoord.BufferObj = ctx->Array.NullBufferObj; ctx->Array.Index.BufferObj = ctx->Array.NullBufferObj; for (i = 0; i < MAX_TEXTURE_UNITS; i++) { ctx->Array.TexCoord[i].BufferObj = ctx->Array.NullBufferObj; } ctx->Array.EdgeFlag.BufferObj = ctx->Array.NullBufferObj; for (i = 0; i < VERT_ATTRIB_MAX; i++) { ctx->Array.VertexAttrib[i].BufferObj = ctx->Array.NullBufferObj; } }
/** * Initialize the state associated with buffer objects */ void _mesa_init_buffer_objects( GLcontext *ctx ) { /* Allocate the default buffer object and set refcount so high that * it never gets deleted. * XXX with recent/improved refcounting this may not longer be needed. */ ctx->Array.NullBufferObj = _mesa_new_buffer_object(ctx, 0, 0); if (ctx->Array.NullBufferObj) ctx->Array.NullBufferObj->RefCount = 1000; ctx->Array.ArrayBufferObj = ctx->Array.NullBufferObj; ctx->Array.ElementArrayBufferObj = ctx->Array.NullBufferObj; }