/*
* Mesa 3-D graphics library
- * Version: 6.3
+ * Version: 6.5
*
- * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 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"),
* \param ctx GL context
* \param target Buffer object target to be retrieved. Currently this must
* be either \c GL_ARRAY_BUFFER or \c GL_ELEMENT_ARRAY_BUFFER.
- * \param str Name of caller for logging errors.
+ * \param caller Name of calling function for recording errors.
* \return A pointer to the buffer object bound to \c target in the
* specified context or \c NULL if \c target is invalid or no
* buffer object is bound.
*/
static INLINE struct gl_buffer_object *
-buffer_object_get_target( GLcontext *ctx, GLenum target, const char * str )
+buffer_object_get_target(GLcontext *ctx, GLenum target, const char *caller)
{
struct gl_buffer_object * bufObj = NULL;
bufObj = ctx->Unpack.BufferObj;
break;
default:
- _mesa_error(ctx, GL_INVALID_ENUM, "gl%s(target)", str);
+ _mesa_error(ctx, GL_INVALID_ENUM, "gl%s(target)", caller);
return NULL;
}
* \param target Buffer object target on which to operate.
* \param offset Offset of the first byte of the subdata range.
* \param size Size, in bytes, of the subdata range.
- * \param str Name of caller for logging errors.
+ * \param caller Name of calling function for recording errors.
* \return A pointer to the buffer object bound to \c target in the
* specified context or \c NULL if any of the parameter or state
* conditions for \c glBufferSubDataARB or \c glGetBufferSubDataARB
static struct gl_buffer_object *
buffer_object_subdata_range_good( GLcontext * ctx, GLenum target,
GLintptrARB offset, GLsizeiptrARB size,
- const char * str )
+ const char *caller )
{
struct gl_buffer_object *bufObj;
if (size < 0) {
- _mesa_error(ctx, GL_INVALID_VALUE, "%s(size < 0)", str);
+ _mesa_error(ctx, GL_INVALID_VALUE, "%s(size < 0)", caller);
return NULL;
}
if (offset < 0) {
- _mesa_error(ctx, GL_INVALID_VALUE, "%s(offset < 0)", str);
+ _mesa_error(ctx, GL_INVALID_VALUE, "%s(offset < 0)", caller);
return NULL;
}
- bufObj = buffer_object_get_target( ctx, target, str );
+ bufObj = buffer_object_get_target(ctx, target, caller);
if (!bufObj || bufObj->Name == 0) {
return NULL;
}
if ((GLuint) (offset + size) > bufObj->Size) {
_mesa_error(ctx, GL_INVALID_VALUE,
- "%s(size + offset > buffer size)", str);
+ "%s(size + offset > buffer size)", caller);
return NULL;
}
if (bufObj->Pointer) {
/* Buffer is currently mapped */
- _mesa_error(ctx, GL_INVALID_OPERATION, "%s", str);
+ _mesa_error(ctx, GL_INVALID_OPERATION, "%s", caller);
return NULL;
}
newBufObj = (struct gl_buffer_object *) _mesa_HashLookup(hash, buffer);
if (!newBufObj) {
/* if this is a new buffer object id, allocate a buffer object now */
- newBufObj = (*ctx->Driver.NewBufferObject)(ctx, buffer, target);
+ ASSERT(ctx->Driver.NewBufferObject);
+ newBufObj = ctx->Driver.NewBufferObject(ctx, buffer, target);
if (!newBufObj) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glBindBufferARB");
return;
/* Pass BindBuffer call to device driver */
if (ctx->Driver.BindBuffer && newBufObj)
- (*ctx->Driver.BindBuffer)( ctx, target, newBufObj );
+ ctx->Driver.BindBuffer( ctx, target, newBufObj );
if (oldBufObj) {
oldBufObj->RefCount--;
struct gl_buffer_object *bufObj;
GLuint name = first + i;
GLenum target = 0;
- bufObj = (*ctx->Driver.NewBufferObject)( ctx, name, target );
+ bufObj = ctx->Driver.NewBufferObject( ctx, name, target );
if (!bufObj) {
_glthread_UNLOCK_MUTEX(ctx->Shared->Mutex);
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glGenBuffersARB");
ASSERT(ctx->Driver.BufferData);
/* Give the buffer object to the driver! <data> may be null! */
- (*ctx->Driver.BufferData)( ctx, target, size, data, usage, bufObj );
+ ctx->Driver.BufferData( ctx, target, size, data, usage, bufObj );
}
}
ASSERT(ctx->Driver.BufferSubData);
- (*ctx->Driver.BufferSubData)( ctx, target, offset, size, data, bufObj );
+ ctx->Driver.BufferSubData( ctx, target, offset, size, data, bufObj );
}
}
ASSERT(ctx->Driver.GetBufferSubData);
- (*ctx->Driver.GetBufferSubData)( ctx, target, offset, size, data, bufObj );
+ ctx->Driver.GetBufferSubData( ctx, target, offset, size, data, bufObj );
}
}
ASSERT(ctx->Driver.MapBuffer);
- bufObj->Pointer = (*ctx->Driver.MapBuffer)( ctx, target, access, bufObj );
+ bufObj->Pointer = ctx->Driver.MapBuffer( ctx, target, access, bufObj );
if (!bufObj->Pointer) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glMapBufferARB(access)");
}
}
if (ctx->Driver.UnmapBuffer) {
- status = (*ctx->Driver.UnmapBuffer)( ctx, target, bufObj );
+ status = ctx->Driver.UnmapBuffer( ctx, target, bufObj );
}
bufObj->Access = GL_READ_WRITE_ARB; /* initial value, OK? */