Commit 0207b47a authored by Ian Romanick's avatar Ian Romanick

Added most of the infrastructure required to support

ARB_vertex_buffer_object.  THIS IS INCOMPLETE.
parent 0a363f4e
This diff is collapsed.
......@@ -840,6 +840,8 @@ alloc_shared_state( GLcontext *ctx )
goto cleanup;
#endif
ss->BufferObjects = _mesa_NewHashTable();
ss->Default1D = (*ctx->Driver.NewTextureObject)(ctx, 0, GL_TEXTURE_1D);
if (!ss->Default1D)
goto cleanup;
......@@ -895,6 +897,9 @@ alloc_shared_state( GLcontext *ctx )
if (ss->DefaultFragmentProgram)
_mesa_delete_program(ctx, ss->DefaultFragmentProgram);
#endif
if (ss->BufferObjects)
_mesa_DeleteHashTable(ss->BufferObjects);
if (ss->Default1D)
(*ctx->Driver.DeleteTexture)(ctx, ss->Default1D);
if (ss->Default2D)
......@@ -972,6 +977,8 @@ free_shared_state( GLcontext *ctx, struct gl_shared_state *ss )
_mesa_DeleteHashTable(ss->Programs);
#endif
_mesa_DeleteHashTable(ss->BufferObjects);
_glthread_DESTROY_MUTEX(ss->Mutex);
FREE(ss);
......
......@@ -829,6 +829,39 @@ struct dd_function_table {
*/
void (*UnlockArraysEXT)( GLcontext *ctx );
/*@}*/
/**
* \name Vertex buffer object functions
*/
/*@{*/
void (*BindBuffer)( GLcontext *ctx, GLenum target,
struct gl_buffer_object *obj );
struct gl_buffer_object * (*NewBufferObject)( GLcontext *ctx, int buffer,
GLenum target );
void (*DeleteBuffer)( GLcontext *ctx, struct gl_buffer_object *obj );
void (*BufferData)( GLcontext *ctx, GLenum target, GLsizeiptrARB size,
const GLvoid *data, GLenum usage,
struct gl_buffer_object *obj );
void (*BufferSubData)( GLcontext *ctx, GLenum target, GLintptrARB offset,
GLsizeiptrARB size, const GLvoid *data,
struct gl_buffer_object *obj );
void (*GetBufferSubData)( GLcontext *ctx, GLenum target,
GLintptrARB offset, GLsizeiptrARB size,
GLvoid *data, struct gl_buffer_object *obj );
void * (*MapBuffer)( GLcontext *ctx, GLenum target, GLenum access,
struct gl_buffer_object *obj );
GLboolean (*UnmapBuffer)( GLcontext *ctx, GLenum target,
struct gl_buffer_object *obj );
/*@}*/
};
......
......@@ -1598,6 +1598,9 @@ struct gl_shared_state
#endif
/*@}*/
/** GL_ARB_vertex_buffer_objects */
struct _mesa_HashTable *BufferObjects;
void *DriverData; /**< Device driver shared state */
};
......@@ -1985,6 +1988,7 @@ typedef union node Node;
/* This has to be included here. */
struct gl_buffer_object;
#include "dd.h"
......@@ -2220,6 +2224,18 @@ struct __GLcontextRec {
/** Core tnl module support */
struct gl_tnl_module TnlModule;
/**
* \name GL_ARB_vertex_buffer_object state
*
* These pointers track the buffer objects last bound via
* \c glBindBufferObjectARB. If it the last bound object ID was 0 for a
* given target, the pointer will be \c NULL.
*/
/*@{*/
struct gl_buffer_object * ArrayBuffer;
struct gl_buffer_object * ElementArrayBuffer;
/*@}*/
/**
* \name Hooks for module contexts.
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment