16dc85575000127630489b407c50a4b3ea87c9acbKeith Whitwell/** 26dc85575000127630489b407c50a4b3ea87c9acbKeith Whitwell * \file dlist.h 36dc85575000127630489b407c50a4b3ea87c9acbKeith Whitwell * Display lists management. 46dc85575000127630489b407c50a4b3ea87c9acbKeith Whitwell */ 5afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg 6afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg/* 7afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg * Mesa 3-D graphics library 8d179e16501c408e1c57e436d5cf597c91f7ef040Brian Paul * Version: 6.5.1 95e3bc0c2a2bcdf59949410f94c9b705fc1281ce8Jouk Jansen * 10d179e16501c408e1c57e436d5cf597c91f7ef040Brian Paul * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. 115e3bc0c2a2bcdf59949410f94c9b705fc1281ce8Jouk Jansen * 12afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg * Permission is hereby granted, free of charge, to any person obtaining a 13afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg * copy of this software and associated documentation files (the "Software"), 14afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg * to deal in the Software without restriction, including without limitation 15afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg * the rights to use, copy, modify, merge, publish, distribute, sublicense, 16afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg * and/or sell copies of the Software, and to permit persons to whom the 17afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg * Software is furnished to do so, subject to the following conditions: 185e3bc0c2a2bcdf59949410f94c9b705fc1281ce8Jouk Jansen * 19afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg * The above copyright notice and this permission notice shall be included 20afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg * in all copies or substantial portions of the Software. 215e3bc0c2a2bcdf59949410f94c9b705fc1281ce8Jouk Jansen * 22afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 23afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 25afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 26afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 27afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 28afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg */ 29afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg 30afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg 316dc85575000127630489b407c50a4b3ea87c9acbKeith Whitwell 32afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg#ifndef DLIST_H 33afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg#define DLIST_H 34afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg 35afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg 36db61b9ce39bccc43140357652ceb78baaf2aea44Vinson Lee#include "main/mfeatures.h" 37a73ba2d31b87e974f6846a8aaced704634f6f657Chia-I Wu#include "main/mtypes.h" 38afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg 399c4f016d2171319ad8cde2366d76fd7f70520621Brian Paul 40a73ba2d31b87e974f6846a8aaced704634f6f657Chia-I Wu#if FEATURE_dlist 416dc85575000127630489b407c50a4b3ea87c9acbKeith Whitwell 42a73ba2d31b87e974f6846a8aaced704634f6f657Chia-I Wu#define _MESA_INIT_DLIST_VTXFMT(vfmt, impl) \ 43a73ba2d31b87e974f6846a8aaced704634f6f657Chia-I Wu do { \ 44a73ba2d31b87e974f6846a8aaced704634f6f657Chia-I Wu (vfmt)->CallList = impl ## CallList; \ 45a73ba2d31b87e974f6846a8aaced704634f6f657Chia-I Wu (vfmt)->CallLists = impl ## CallLists; \ 46a73ba2d31b87e974f6846a8aaced704634f6f657Chia-I Wu } while (0) 47afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg 48c40d1dd62dd9bcbb97128e37a75d991a8d3b2d8cKendall Bennettextern void GLAPIENTRY _mesa_CallList( GLuint list ); 49afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg 50c40d1dd62dd9bcbb97128e37a75d991a8d3b2d8cKendall Bennettextern void GLAPIENTRY _mesa_CallLists( GLsizei n, GLenum type, const GLvoid *lists ); 51afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg 52afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg 53f9995b30756140724f41daf963fa06167912be7fKristian Høgsbergextern void _mesa_compile_error( struct gl_context *ctx, GLenum error, const char *s ); 54afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg 55f9995b30756140724f41daf963fa06167912be7fKristian Høgsbergextern void *_mesa_dlist_alloc(struct gl_context *ctx, GLuint opcode, GLuint sz); 5686b842790b720cd6b1499ce8edca8a4e9c8dc029Brian Paul 57f9995b30756140724f41daf963fa06167912be7fKristian Høgsbergextern GLint _mesa_dlist_alloc_opcode( struct gl_context *ctx, GLuint sz, 58f9995b30756140724f41daf963fa06167912be7fKristian Høgsberg void (*execute)( struct gl_context *, void * ), 59f9995b30756140724f41daf963fa06167912be7fKristian Høgsberg void (*destroy)( struct gl_context *, void * ), 60f9995b30756140724f41daf963fa06167912be7fKristian Høgsberg void (*print)( struct gl_context *, void * ) ); 6123caf20169ac38436ee9c13914f1d6aa7cf6bb5eKeith Whitwell 62f9995b30756140724f41daf963fa06167912be7fKristian Høgsbergextern void _mesa_delete_list(struct gl_context *ctx, struct gl_display_list *dlist); 63a764b7eae0e93245b0fb644d32e72226d4cf42f2Brian Paul 64ae0eaf93e092ac8e8b1c98f3e986de96940663faKeith Whitwellextern void _mesa_save_vtxfmt_init( GLvertexformat *vfmt ); 65ae0eaf93e092ac8e8b1c98f3e986de96940663faKeith Whitwell 66c01f89606214e1b630c9a58c5dafc1aca2b97f40Ian Romanickextern struct _glapi_table *_mesa_create_save_table(const struct gl_context *); 67a73ba2d31b87e974f6846a8aaced704634f6f657Chia-I Wu 68a73ba2d31b87e974f6846a8aaced704634f6f657Chia-I Wuextern void _mesa_install_dlist_vtxfmt(struct _glapi_table *disp, 69a73ba2d31b87e974f6846a8aaced704634f6f657Chia-I Wu const GLvertexformat *vfmt); 70a73ba2d31b87e974f6846a8aaced704634f6f657Chia-I Wu 71a73ba2d31b87e974f6846a8aaced704634f6f657Chia-I Wuextern void _mesa_init_dlist_dispatch(struct _glapi_table *disp); 726dc85575000127630489b407c50a4b3ea87c9acbKeith Whitwell 73a73ba2d31b87e974f6846a8aaced704634f6f657Chia-I Wu#else /* FEATURE_dlist */ 746dc85575000127630489b407c50a4b3ea87c9acbKeith Whitwell 758043bf555e14cf20826753d59d66d0cef7a5e5a0Chia-I Wu#include "main/compiler.h" 768043bf555e14cf20826753d59d66d0cef7a5e5a0Chia-I Wu 77a73ba2d31b87e974f6846a8aaced704634f6f657Chia-I Wu#define _MESA_INIT_DLIST_VTXFMT(vfmt, impl) do { } while (0) 786dc85575000127630489b407c50a4b3ea87c9acbKeith Whitwell 799520f483b8f1e45fa474674b415554988de5d8d3Brian Paulstatic inline void 80f9995b30756140724f41daf963fa06167912be7fKristian Høgsberg_mesa_delete_list(struct gl_context *ctx, struct gl_display_list *dlist) 81a73ba2d31b87e974f6846a8aaced704634f6f657Chia-I Wu{ 82a73ba2d31b87e974f6846a8aaced704634f6f657Chia-I Wu /* there should be no list to delete */ 83a73ba2d31b87e974f6846a8aaced704634f6f657Chia-I Wu ASSERT_NO_FEATURE(); 84a73ba2d31b87e974f6846a8aaced704634f6f657Chia-I Wu} 856dc85575000127630489b407c50a4b3ea87c9acbKeith Whitwell 869520f483b8f1e45fa474674b415554988de5d8d3Brian Paulstatic inline void 87a73ba2d31b87e974f6846a8aaced704634f6f657Chia-I Wu_mesa_install_dlist_vtxfmt(struct _glapi_table *disp, 88a73ba2d31b87e974f6846a8aaced704634f6f657Chia-I Wu const GLvertexformat *vfmt) 89a73ba2d31b87e974f6846a8aaced704634f6f657Chia-I Wu{ 90a73ba2d31b87e974f6846a8aaced704634f6f657Chia-I Wu} 91a73ba2d31b87e974f6846a8aaced704634f6f657Chia-I Wu 929520f483b8f1e45fa474674b415554988de5d8d3Brian Paulstatic inline void 93a73ba2d31b87e974f6846a8aaced704634f6f657Chia-I Wu_mesa_init_dlist_dispatch(struct _glapi_table *disp) 94a73ba2d31b87e974f6846a8aaced704634f6f657Chia-I Wu{ 95a73ba2d31b87e974f6846a8aaced704634f6f657Chia-I Wu} 96a73ba2d31b87e974f6846a8aaced704634f6f657Chia-I Wu 97a73ba2d31b87e974f6846a8aaced704634f6f657Chia-I Wu#endif /* FEATURE_dlist */ 98a73ba2d31b87e974f6846a8aaced704634f6f657Chia-I Wu 99f9995b30756140724f41daf963fa06167912be7fKristian Høgsbergextern void _mesa_init_display_list( struct gl_context * ctx ); 100ae0eaf93e092ac8e8b1c98f3e986de96940663faKeith Whitwell 101f9995b30756140724f41daf963fa06167912be7fKristian Høgsbergextern void _mesa_free_display_list_data(struct gl_context *ctx); 10215f05e97aac46ffcf8a7765b0072535718833622Brian Paul 10323caf20169ac38436ee9c13914f1d6aa7cf6bb5eKeith Whitwell 104a73ba2d31b87e974f6846a8aaced704634f6f657Chia-I Wu#endif /* DLIST_H */ 105