b8d115cd8297a27bece00e9b8e6d789cfc9be6ef
3 * Display lists management.
7 * Mesa 3-D graphics library
10 * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
12 * Permission is hereby granted, free of charge, to any person obtaining a
13 * copy of this software and associated documentation files (the "Software"),
14 * to deal in the Software without restriction, including without limitation
15 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
16 * and/or sell copies of the Software, and to permit persons to whom the
17 * Software is furnished to do so, subject to the following conditions:
19 * The above copyright notice and this permission notice shall be included
20 * in all copies or substantial portions of the Software.
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
23 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
25 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
26 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
27 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
40 * Macro to assert that the API call was made outside the
41 * glBegin()/glEnd() pair, with return value.
43 * \param ctx GL context.
44 * \param retval value to return value in case the assertion fails.
46 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval) \
48 if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON || \
49 ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \
50 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "begin/end" ); \
56 * Macro to assert that the API call was made outside the
57 * glBegin()/glEnd() pair.
59 * \param ctx GL context.
61 #define ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx) \
63 if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON || \
64 ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \
65 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "begin/end" ); \
71 * Macro to assert that the API call was made outside the
72 * glBegin()/glEnd() pair and flush the vertices.
74 * \param ctx GL context.
76 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx) \
78 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx); \
79 FLUSH_VERTICES(ctx, 0); \
83 * Macro to assert that the API call was made outside the
84 * glBegin()/glEnd() pair and flush the vertices, with return value.
86 * \param ctx GL context.
87 * \param retval value to return value in case the assertion fails.
89 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, retval)\
91 ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval); \
92 FLUSH_VERTICES(ctx, 0); \
98 extern void _mesa_init_lists( void );
100 extern void _mesa_destroy_list( GLcontext
*ctx
, GLuint list
);
102 extern void _mesa_CallList( GLuint list
);
104 extern void _mesa_CallLists( GLsizei n
, GLenum type
, const GLvoid
*lists
);
106 extern void _mesa_DeleteLists( GLuint list
, GLsizei range
);
108 extern void _mesa_EndList( void );
110 extern GLuint
_mesa_GenLists( GLsizei range
);
112 extern GLboolean
_mesa_IsList( GLuint list
);
114 extern void _mesa_ListBase( GLuint base
);
116 extern void _mesa_NewList( GLuint list
, GLenum mode
);
118 extern void _mesa_init_dlist_table( struct _glapi_table
*table
,
121 extern void _mesa_save_error( GLcontext
*ctx
, GLenum error
, const char *s
);
123 extern void _mesa_compile_error( GLcontext
*ctx
, GLenum error
, const char *s
);
126 extern void *_mesa_alloc_instruction( GLcontext
*ctx
, int opcode
, GLint sz
);
128 extern int _mesa_alloc_opcode( GLcontext
*ctx
, GLuint sz
,
129 void (*execute
)( GLcontext
*, void * ),
130 void (*destroy
)( GLcontext
*, void * ),
131 void (*print
)( GLcontext
*, void * ) );
133 extern void _mesa_save_EvalMesh2(GLenum mode
, GLint i1
, GLint i2
,
134 GLint j1
, GLint j2
);
135 extern void _mesa_save_EvalMesh1( GLenum mode
, GLint i1
, GLint i2
);
136 extern void _mesa_save_CallLists( GLsizei n
, GLenum type
, const GLvoid
*lists
);
137 extern void _mesa_save_CallList( GLuint list
);
138 extern void _mesa_init_display_list( GLcontext
* ctx
);
143 #define _mesa_init_lists() ((void)0)
146 #define _mesa_destroy_list(c,l) ((void)0)
149 #define _mesa_init_dlist_table(t,ts) ((void)0)
152 #define _mesa_init_display_list(c) ((void)0)