draw.h revision 01e04c3f
101e04c3fSmrg/* 201e04c3fSmrg * mesa 3-D graphics library 301e04c3fSmrg * 401e04c3fSmrg * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. 501e04c3fSmrg * 601e04c3fSmrg * Permission is hereby granted, free of charge, to any person obtaining a 701e04c3fSmrg * copy of this software and associated documentation files (the "Software"), 801e04c3fSmrg * to deal in the Software without restriction, including without limitation 901e04c3fSmrg * the rights to use, copy, modify, merge, publish, distribute, sublicense, 1001e04c3fSmrg * and/or sell copies of the Software, and to permit persons to whom the 1101e04c3fSmrg * Software is furnished to do so, subject to the following conditions: 1201e04c3fSmrg * 1301e04c3fSmrg * The above copyright notice and this permission notice shall be included 1401e04c3fSmrg * in all copies or substantial portions of the Software. 1501e04c3fSmrg * 1601e04c3fSmrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 1701e04c3fSmrg * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 1801e04c3fSmrg * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 1901e04c3fSmrg * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 2001e04c3fSmrg * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 2101e04c3fSmrg * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 2201e04c3fSmrg * OTHER DEALINGS IN THE SOFTWARE. 2301e04c3fSmrg */ 2401e04c3fSmrg 2501e04c3fSmrg/** 2601e04c3fSmrg * \brief Array type draw functions, the main workhorse of any OpenGL API 2701e04c3fSmrg * \author Keith Whitwell 2801e04c3fSmrg */ 2901e04c3fSmrg 3001e04c3fSmrg 3101e04c3fSmrg#ifndef DRAW_H 3201e04c3fSmrg#define DRAW_H 3301e04c3fSmrg 3401e04c3fSmrg#include <stdbool.h> 3501e04c3fSmrg#include "main/glheader.h" 3601e04c3fSmrg 3701e04c3fSmrg#ifdef __cplusplus 3801e04c3fSmrgextern "C" { 3901e04c3fSmrg#endif 4001e04c3fSmrg 4101e04c3fSmrgstruct gl_context; 4201e04c3fSmrg 4301e04c3fSmrgstruct _mesa_prim 4401e04c3fSmrg{ 4501e04c3fSmrg GLuint mode:8; /**< GL_POINTS, GL_LINES, GL_QUAD_STRIP, etc */ 4601e04c3fSmrg GLuint indexed:1; 4701e04c3fSmrg GLuint begin:1; 4801e04c3fSmrg GLuint end:1; 4901e04c3fSmrg GLuint is_indirect:1; 5001e04c3fSmrg GLuint pad:20; 5101e04c3fSmrg 5201e04c3fSmrg GLuint start; 5301e04c3fSmrg GLuint count; 5401e04c3fSmrg GLint basevertex; 5501e04c3fSmrg GLuint num_instances; 5601e04c3fSmrg GLuint base_instance; 5701e04c3fSmrg GLuint draw_id; 5801e04c3fSmrg 5901e04c3fSmrg GLsizeiptr indirect_offset; 6001e04c3fSmrg}; 6101e04c3fSmrg 6201e04c3fSmrg/* Would like to call this a "vbo_index_buffer", but this would be 6301e04c3fSmrg * confusing as the indices are not neccessarily yet in a non-null 6401e04c3fSmrg * buffer object. 6501e04c3fSmrg */ 6601e04c3fSmrgstruct _mesa_index_buffer 6701e04c3fSmrg{ 6801e04c3fSmrg GLuint count; 6901e04c3fSmrg unsigned index_size; 7001e04c3fSmrg struct gl_buffer_object *obj; 7101e04c3fSmrg const void *ptr; 7201e04c3fSmrg}; 7301e04c3fSmrg 7401e04c3fSmrg 7501e04c3fSmrgvoid 7601e04c3fSmrg_mesa_initialize_exec_dispatch(const struct gl_context *ctx, 7701e04c3fSmrg struct _glapi_table *exec); 7801e04c3fSmrg 7901e04c3fSmrg 8001e04c3fSmrgvoid 8101e04c3fSmrg_mesa_draw_indirect(struct gl_context *ctx, GLuint mode, 8201e04c3fSmrg struct gl_buffer_object *indirect_data, 8301e04c3fSmrg GLsizeiptr indirect_offset, unsigned draw_count, 8401e04c3fSmrg unsigned stride, 8501e04c3fSmrg struct gl_buffer_object *indirect_draw_count_buffer, 8601e04c3fSmrg GLsizeiptr indirect_draw_count_offset, 8701e04c3fSmrg const struct _mesa_index_buffer *ib); 8801e04c3fSmrg 8901e04c3fSmrg 9001e04c3fSmrgvoid GLAPIENTRY 9101e04c3fSmrg_mesa_DrawArrays(GLenum mode, GLint first, GLsizei count); 9201e04c3fSmrg 9301e04c3fSmrg 9401e04c3fSmrgvoid GLAPIENTRY 9501e04c3fSmrg_mesa_DrawArraysInstanced(GLenum mode, GLint first, GLsizei count, 9601e04c3fSmrg GLsizei primcount); 9701e04c3fSmrg 9801e04c3fSmrg 9901e04c3fSmrgvoid GLAPIENTRY 10001e04c3fSmrg_mesa_DrawElements(GLenum mode, GLsizei count, GLenum type, 10101e04c3fSmrg const GLvoid *indices); 10201e04c3fSmrg 10301e04c3fSmrg 10401e04c3fSmrgvoid GLAPIENTRY 10501e04c3fSmrg_mesa_DrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, 10601e04c3fSmrg GLenum type, const GLvoid *indices); 10701e04c3fSmrg 10801e04c3fSmrg 10901e04c3fSmrgvoid GLAPIENTRY 11001e04c3fSmrg_mesa_DrawElementsBaseVertex(GLenum mode, GLsizei count, GLenum type, 11101e04c3fSmrg const GLvoid *indices, GLint basevertex); 11201e04c3fSmrg 11301e04c3fSmrg 11401e04c3fSmrgvoid GLAPIENTRY 11501e04c3fSmrg_mesa_DrawRangeElementsBaseVertex(GLenum mode, GLuint start, GLuint end, 11601e04c3fSmrg GLsizei count, GLenum type, 11701e04c3fSmrg const GLvoid *indices, 11801e04c3fSmrg GLint basevertex); 11901e04c3fSmrg 12001e04c3fSmrg 12101e04c3fSmrgvoid GLAPIENTRY 12201e04c3fSmrg_mesa_DrawTransformFeedback(GLenum mode, GLuint name); 12301e04c3fSmrg 12401e04c3fSmrg 12501e04c3fSmrg 12601e04c3fSmrgvoid GLAPIENTRY 12701e04c3fSmrg_mesa_MultiDrawArrays(GLenum mode, const GLint *first, 12801e04c3fSmrg const GLsizei *count, GLsizei primcount); 12901e04c3fSmrg 13001e04c3fSmrg 13101e04c3fSmrgvoid GLAPIENTRY 13201e04c3fSmrg_mesa_MultiDrawElementsEXT(GLenum mode, const GLsizei *count, GLenum type, 13301e04c3fSmrg const GLvoid **indices, GLsizei primcount); 13401e04c3fSmrg 13501e04c3fSmrg 13601e04c3fSmrgvoid GLAPIENTRY 13701e04c3fSmrg_mesa_MultiDrawElementsBaseVertex(GLenum mode, 13801e04c3fSmrg const GLsizei *count, GLenum type, 13901e04c3fSmrg const GLvoid **indices, GLsizei primcount, 14001e04c3fSmrg const GLint *basevertex); 14101e04c3fSmrg 14201e04c3fSmrg 14301e04c3fSmrgvoid GLAPIENTRY 14401e04c3fSmrg_mesa_MultiModeDrawArraysIBM(const GLenum * mode, const GLint * first, 14501e04c3fSmrg const GLsizei * count, 14601e04c3fSmrg GLsizei primcount, GLint modestride); 14701e04c3fSmrg 14801e04c3fSmrg 14901e04c3fSmrgvoid GLAPIENTRY 15001e04c3fSmrg_mesa_MultiModeDrawElementsIBM(const GLenum * mode, const GLsizei * count, 15101e04c3fSmrg GLenum type, const GLvoid * const * indices, 15201e04c3fSmrg GLsizei primcount, GLint modestride); 15301e04c3fSmrg 15401e04c3fSmrg 15501e04c3fSmrg#ifdef __cplusplus 15601e04c3fSmrg} // extern "C" 15701e04c3fSmrg#endif 15801e04c3fSmrg 15901e04c3fSmrg#endif 160