Make the transition to script-genereated GLX code easier.
[mesa.git] / src / glx / x11 / dispatch.c
1 /* $XFree86: xc/lib/GL/glx/dispatch.c,v 1.5 2003/06/30 01:45:10 torrey Exp $ */
2 /**************************************************************************
3
4 Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
5 All Rights Reserved.
6
7 Permission is hereby granted, free of charge, to any person obtaining a
8 copy of this software and associated documentation files (the
9 "Software"), to deal in the Software without restriction, including
10 without limitation the rights to use, copy, modify, merge, publish,
11 distribute, sub license, and/or sell copies of the Software, and to
12 permit persons to whom the Software is furnished to do so, subject to
13 the following conditions:
14
15 The above copyright notice and this permission notice (including the
16 next paragraph) shall be included in all copies or substantial portions
17 of the Software.
18
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
22 IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
23 ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
24 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
25 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26
27 **************************************************************************/
28
29 /*
30 * Authors:
31 * Brian Paul <brian@precisioninsight.com>
32 *
33 */
34
35 #ifndef GLX_USE_APPLEGL
36
37 #include <GL/gl.h>
38 #include "glapi.h"
39 #include "glapitable.h"
40
41
42 /*
43 * NOTE: this file implements C-based dispatch of the OpenGL entrypoints
44 * (glAccum, glBegin, etc).
45 * This code IS NOT USED if we're compiling on an x86 system and using
46 * the glapi_x86.S assembly code.
47 */
48
49
50 #if !(defined(USE_X86_ASM) || defined(USE_SPARC_ASM))
51
52 #define KEYWORD1
53
54 #define KEYWORD2
55
56 #define NAME(func) gl##func
57
58 #define DISPATCH(func, args, msg) \
59 const struct _glapi_table *dispatch; \
60 dispatch = _glapi_Dispatch ? _glapi_Dispatch : _glapi_get_dispatch();\
61 (dispatch->func) args
62
63 #define RETURN_DISPATCH(func, args, msg) \
64 const struct _glapi_table *dispatch; \
65 dispatch = _glapi_Dispatch ? _glapi_Dispatch : _glapi_get_dispatch();\
66 return (dispatch->func) args
67
68
69 #include "glapitemp.h"
70
71 #endif /* USE_X86_ASM */
72
73 #endif /* !GLX_USE_APPLEGL */