vbo.h revision 01e04c3f
17117f1b4Smrg/*
27117f1b4Smrg * mesa 3-D graphics library
37117f1b4Smrg *
47117f1b4Smrg * Copyright (C) 1999-2006  Brian Paul   All Rights Reserved.
57117f1b4Smrg *
67117f1b4Smrg * Permission is hereby granted, free of charge, to any person obtaining a
77117f1b4Smrg * copy of this software and associated documentation files (the "Software"),
87117f1b4Smrg * to deal in the Software without restriction, including without limitation
97117f1b4Smrg * the rights to use, copy, modify, merge, publish, distribute, sublicense,
107117f1b4Smrg * and/or sell copies of the Software, and to permit persons to whom the
117117f1b4Smrg * Software is furnished to do so, subject to the following conditions:
127117f1b4Smrg *
137117f1b4Smrg * The above copyright notice and this permission notice shall be included
147117f1b4Smrg * in all copies or substantial portions of the Software.
157117f1b4Smrg *
167117f1b4Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
177117f1b4Smrg * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
187117f1b4Smrg * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
19af69d88dSmrg * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20af69d88dSmrg * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21af69d88dSmrg * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22af69d88dSmrg * OTHER DEALINGS IN THE SOFTWARE.
237117f1b4Smrg */
247117f1b4Smrg
257117f1b4Smrg/**
2601e04c3fSmrg * \brief Public interface to the VBO module
277117f1b4Smrg * \author Keith Whitwell
287117f1b4Smrg */
297117f1b4Smrg
307117f1b4Smrg
317117f1b4Smrg#ifndef _VBO_H
327117f1b4Smrg#define _VBO_H
337117f1b4Smrg
34af69d88dSmrg#include <stdbool.h>
353464ebd5Sriastradh#include "main/glheader.h"
3601e04c3fSmrg#include "main/draw.h"
3701e04c3fSmrg
3801e04c3fSmrg#ifdef __cplusplus
3901e04c3fSmrgextern "C" {
4001e04c3fSmrg#endif
413464ebd5Sriastradh
423464ebd5Sriastradhstruct gl_context;
437117f1b4Smrg
4401e04c3fSmrgGLboolean
4501e04c3fSmrg_vbo_CreateContext(struct gl_context *ctx);
467117f1b4Smrg
4701e04c3fSmrgvoid
4801e04c3fSmrg_vbo_DestroyContext(struct gl_context *ctx);
497117f1b4Smrg
5001e04c3fSmrgvoid
5101e04c3fSmrgvbo_exec_invalidate_state(struct gl_context *ctx);
527117f1b4Smrg
5301e04c3fSmrgvoid
5401e04c3fSmrg_vbo_install_exec_vtxfmt(struct gl_context *ctx);
557117f1b4Smrg
56af69d88dSmrgvoid
57af69d88dSmrgvbo_initialize_exec_dispatch(const struct gl_context *ctx,
58af69d88dSmrg                             struct _glapi_table *exec);
59af69d88dSmrg
60af69d88dSmrgvoid
61af69d88dSmrgvbo_initialize_save_dispatch(const struct gl_context *ctx,
62af69d88dSmrg                             struct _glapi_table *exec);
63af69d88dSmrg
6401e04c3fSmrgvoid
6501e04c3fSmrgvbo_exec_FlushVertices(struct gl_context *ctx, GLuint flags);
66af69d88dSmrg
6701e04c3fSmrgvoid
6801e04c3fSmrgvbo_save_SaveFlushVertices(struct gl_context *ctx);
697117f1b4Smrg
7001e04c3fSmrgvoid
7101e04c3fSmrgvbo_save_NotifyBegin(struct gl_context *ctx, GLenum mode,
7201e04c3fSmrg                     bool no_current_update);
737117f1b4Smrg
7401e04c3fSmrgvoid
7501e04c3fSmrgvbo_save_NewList(struct gl_context *ctx, GLuint list, GLenum mode);
767117f1b4Smrg
7701e04c3fSmrgvoid
7801e04c3fSmrgvbo_save_EndList(struct gl_context *ctx);
797117f1b4Smrg
8001e04c3fSmrgvoid
8101e04c3fSmrgvbo_save_BeginCallList(struct gl_context *ctx, struct gl_display_list *list);
827117f1b4Smrg
8301e04c3fSmrgvoid
8401e04c3fSmrgvbo_save_EndCallList(struct gl_context *ctx);
857117f1b4Smrg
867117f1b4Smrg
8701e04c3fSmrgvoid
8801e04c3fSmrgvbo_delete_minmax_cache(struct gl_buffer_object *bufferObj);
89af69d88dSmrg
904a49301eSmrgvoid
91af69d88dSmrgvbo_get_minmax_indices(struct gl_context *ctx, const struct _mesa_prim *prim,
92af69d88dSmrg                       const struct _mesa_index_buffer *ib,
93af69d88dSmrg                       GLuint *min_index, GLuint *max_index, GLuint nr_prims);
947117f1b4Smrg
95af69d88dSmrgvoid
9601e04c3fSmrgvbo_use_buffer_objects(struct gl_context *ctx);
97af69d88dSmrg
98af69d88dSmrgvoid
9901e04c3fSmrgvbo_always_unmap_buffers(struct gl_context *ctx);
100af69d88dSmrg
101af69d88dSmrgvoid
102af69d88dSmrgvbo_sw_primitive_restart(struct gl_context *ctx,
103af69d88dSmrg                         const struct _mesa_prim *prim,
104af69d88dSmrg                         GLuint nr_prims,
105af69d88dSmrg                         const struct _mesa_index_buffer *ib,
106af69d88dSmrg                         struct gl_buffer_object *indirect);
1073464ebd5Sriastradh
10801e04c3fSmrg
10901e04c3fSmrgconst struct gl_array_attributes*
11001e04c3fSmrg_vbo_current_attrib(const struct gl_context *ctx, gl_vert_attrib attr);
11101e04c3fSmrg
11201e04c3fSmrg
11301e04c3fSmrgconst struct gl_vertex_buffer_binding*
11401e04c3fSmrg_vbo_current_binding(const struct gl_context *ctx);
11501e04c3fSmrg
11601e04c3fSmrg
1173464ebd5Sriastradhvoid GLAPIENTRY
1183464ebd5Sriastradh_es_Color4f(GLfloat r, GLfloat g, GLfloat b, GLfloat a);
1193464ebd5Sriastradh
1203464ebd5Sriastradhvoid GLAPIENTRY
1213464ebd5Sriastradh_es_Normal3f(GLfloat x, GLfloat y, GLfloat z);
1223464ebd5Sriastradh
1233464ebd5Sriastradhvoid GLAPIENTRY
1243464ebd5Sriastradh_es_MultiTexCoord4f(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
125c1f859d4Smrg
1263464ebd5Sriastradhvoid GLAPIENTRY
1273464ebd5Sriastradh_es_Materialfv(GLenum face, GLenum pname, const GLfloat *params);
128c1f859d4Smrg
1293464ebd5Sriastradhvoid GLAPIENTRY
1303464ebd5Sriastradh_es_Materialf(GLenum face, GLenum pname, GLfloat param);
1314a49301eSmrg
1323464ebd5Sriastradhvoid GLAPIENTRY
1333464ebd5Sriastradh_es_VertexAttrib4f(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
1343464ebd5Sriastradh
1353464ebd5Sriastradhvoid GLAPIENTRY
1363464ebd5Sriastradh_es_VertexAttrib1f(GLuint indx, GLfloat x);
1373464ebd5Sriastradh
1383464ebd5Sriastradhvoid GLAPIENTRY
1393464ebd5Sriastradh_es_VertexAttrib1fv(GLuint indx, const GLfloat* values);
1404a49301eSmrg
1414a49301eSmrgvoid GLAPIENTRY
1423464ebd5Sriastradh_es_VertexAttrib2f(GLuint indx, GLfloat x, GLfloat y);
1434a49301eSmrg
1444a49301eSmrgvoid GLAPIENTRY
1453464ebd5Sriastradh_es_VertexAttrib2fv(GLuint indx, const GLfloat* values);
1464a49301eSmrg
1474a49301eSmrgvoid GLAPIENTRY
1483464ebd5Sriastradh_es_VertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z);
1494a49301eSmrg
1504a49301eSmrgvoid GLAPIENTRY
1513464ebd5Sriastradh_es_VertexAttrib3fv(GLuint indx, const GLfloat* values);
1524a49301eSmrg
1534a49301eSmrgvoid GLAPIENTRY
1543464ebd5Sriastradh_es_VertexAttrib4fv(GLuint indx, const GLfloat* values);
1554a49301eSmrg
15601e04c3fSmrg#ifdef __cplusplus
15701e04c3fSmrg} // extern "C"
15801e04c3fSmrg#endif
15901e04c3fSmrg
1607117f1b4Smrg#endif
161