Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1901 | serge | 1 | /* |
2 | * Mesa 3-D graphics library |
||
3 | * Version: 6.3 |
||
4 | * |
||
5 | * Copyright (C) 1999-2004 Brian Paul 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 "Software"), |
||
9 | * to deal in the Software without restriction, including without limitation |
||
10 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
||
11 | * and/or sell copies of the Software, and to permit persons to whom the |
||
12 | * Software is furnished to do so, subject to the following conditions: |
||
13 | * |
||
14 | * The above copyright notice and this permission notice shall be included |
||
15 | * in all copies or substantial portions of the Software. |
||
16 | * |
||
17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
||
18 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||
19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
||
20 | * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN |
||
21 | * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
||
22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
||
23 | * |
||
24 | * Authors: |
||
25 | * Keith Whitwell |
||
26 | * Gareth Hughes |
||
27 | */ |
||
28 | |||
29 | #include "glheader.h" |
||
30 | #include "api_arrayelt.h" |
||
31 | #include "context.h" |
||
32 | #include "imports.h" |
||
33 | #include "mtypes.h" |
||
34 | #include "vtxfmt.h" |
||
35 | #include "eval.h" |
||
36 | #include "dlist.h" |
||
37 | #include "main/dispatch.h" |
||
38 | |||
39 | |||
40 | #if FEATURE_beginend |
||
41 | |||
42 | /** |
||
43 | * Use the per-vertex functions found in |
||
44 | * API dispatch table. |
||
45 | */ |
||
46 | static void |
||
47 | install_vtxfmt( struct _glapi_table *tab, const GLvertexformat *vfmt ) |
||
48 | { |
||
49 | _mesa_install_arrayelt_vtxfmt(tab, vfmt); |
||
50 | |||
51 | SET_Color3f(tab, vfmt->Color3f); |
||
52 | SET_Color3fv(tab, vfmt->Color3fv); |
||
53 | SET_Color4f(tab, vfmt->Color4f); |
||
54 | SET_Color4fv(tab, vfmt->Color4fv); |
||
55 | SET_EdgeFlag(tab, vfmt->EdgeFlag); |
||
56 | |||
57 | _mesa_install_eval_vtxfmt(tab, vfmt); |
||
58 | |||
59 | SET_FogCoordfEXT(tab, vfmt->FogCoordfEXT); |
||
60 | SET_FogCoordfvEXT(tab, vfmt->FogCoordfvEXT); |
||
61 | SET_Indexf(tab, vfmt->Indexf); |
||
62 | SET_Indexfv(tab, vfmt->Indexfv); |
||
63 | SET_Materialfv(tab, vfmt->Materialfv); |
||
64 | SET_MultiTexCoord1fARB(tab, vfmt->MultiTexCoord1fARB); |
||
65 | SET_MultiTexCoord1fvARB(tab, vfmt->MultiTexCoord1fvARB); |
||
66 | SET_MultiTexCoord2fARB(tab, vfmt->MultiTexCoord2fARB); |
||
67 | SET_MultiTexCoord2fvARB(tab, vfmt->MultiTexCoord2fvARB); |
||
68 | SET_MultiTexCoord3fARB(tab, vfmt->MultiTexCoord3fARB); |
||
69 | SET_MultiTexCoord3fvARB(tab, vfmt->MultiTexCoord3fvARB); |
||
70 | SET_MultiTexCoord4fARB(tab, vfmt->MultiTexCoord4fARB); |
||
71 | SET_MultiTexCoord4fvARB(tab, vfmt->MultiTexCoord4fvARB); |
||
72 | SET_Normal3f(tab, vfmt->Normal3f); |
||
73 | SET_Normal3fv(tab, vfmt->Normal3fv); |
||
74 | SET_SecondaryColor3fEXT(tab, vfmt->SecondaryColor3fEXT); |
||
75 | SET_SecondaryColor3fvEXT(tab, vfmt->SecondaryColor3fvEXT); |
||
76 | SET_TexCoord1f(tab, vfmt->TexCoord1f); |
||
77 | SET_TexCoord1fv(tab, vfmt->TexCoord1fv); |
||
78 | SET_TexCoord2f(tab, vfmt->TexCoord2f); |
||
79 | SET_TexCoord2fv(tab, vfmt->TexCoord2fv); |
||
80 | SET_TexCoord3f(tab, vfmt->TexCoord3f); |
||
81 | SET_TexCoord3fv(tab, vfmt->TexCoord3fv); |
||
82 | SET_TexCoord4f(tab, vfmt->TexCoord4f); |
||
83 | SET_TexCoord4fv(tab, vfmt->TexCoord4fv); |
||
84 | SET_Vertex2f(tab, vfmt->Vertex2f); |
||
85 | SET_Vertex2fv(tab, vfmt->Vertex2fv); |
||
86 | SET_Vertex3f(tab, vfmt->Vertex3f); |
||
87 | SET_Vertex3fv(tab, vfmt->Vertex3fv); |
||
88 | SET_Vertex4f(tab, vfmt->Vertex4f); |
||
89 | SET_Vertex4fv(tab, vfmt->Vertex4fv); |
||
90 | |||
91 | _mesa_install_dlist_vtxfmt(tab, vfmt); /* glCallList / glCallLists */ |
||
92 | |||
93 | SET_Begin(tab, vfmt->Begin); |
||
94 | SET_End(tab, vfmt->End); |
||
95 | SET_PrimitiveRestartNV(tab, vfmt->PrimitiveRestartNV); |
||
96 | |||
97 | SET_Rectf(tab, vfmt->Rectf); |
||
98 | |||
99 | SET_DrawArrays(tab, vfmt->DrawArrays); |
||
100 | SET_DrawElements(tab, vfmt->DrawElements); |
||
101 | SET_DrawRangeElements(tab, vfmt->DrawRangeElements); |
||
102 | SET_MultiDrawElementsEXT(tab, vfmt->MultiDrawElementsEXT); |
||
103 | SET_DrawElementsBaseVertex(tab, vfmt->DrawElementsBaseVertex); |
||
104 | SET_DrawRangeElementsBaseVertex(tab, vfmt->DrawRangeElementsBaseVertex); |
||
105 | SET_MultiDrawElementsBaseVertex(tab, vfmt->MultiDrawElementsBaseVertex); |
||
106 | SET_DrawArraysInstancedARB(tab, vfmt->DrawArraysInstanced); |
||
107 | SET_DrawElementsInstancedARB(tab, vfmt->DrawElementsInstanced); |
||
108 | |||
109 | /* GL_NV_vertex_program */ |
||
110 | SET_VertexAttrib1fNV(tab, vfmt->VertexAttrib1fNV); |
||
111 | SET_VertexAttrib1fvNV(tab, vfmt->VertexAttrib1fvNV); |
||
112 | SET_VertexAttrib2fNV(tab, vfmt->VertexAttrib2fNV); |
||
113 | SET_VertexAttrib2fvNV(tab, vfmt->VertexAttrib2fvNV); |
||
114 | SET_VertexAttrib3fNV(tab, vfmt->VertexAttrib3fNV); |
||
115 | SET_VertexAttrib3fvNV(tab, vfmt->VertexAttrib3fvNV); |
||
116 | SET_VertexAttrib4fNV(tab, vfmt->VertexAttrib4fNV); |
||
117 | SET_VertexAttrib4fvNV(tab, vfmt->VertexAttrib4fvNV); |
||
118 | #if FEATURE_ARB_vertex_program |
||
119 | SET_VertexAttrib1fARB(tab, vfmt->VertexAttrib1fARB); |
||
120 | SET_VertexAttrib1fvARB(tab, vfmt->VertexAttrib1fvARB); |
||
121 | SET_VertexAttrib2fARB(tab, vfmt->VertexAttrib2fARB); |
||
122 | SET_VertexAttrib2fvARB(tab, vfmt->VertexAttrib2fvARB); |
||
123 | SET_VertexAttrib3fARB(tab, vfmt->VertexAttrib3fARB); |
||
124 | SET_VertexAttrib3fvARB(tab, vfmt->VertexAttrib3fvARB); |
||
125 | SET_VertexAttrib4fARB(tab, vfmt->VertexAttrib4fARB); |
||
126 | SET_VertexAttrib4fvARB(tab, vfmt->VertexAttrib4fvARB); |
||
127 | #endif |
||
128 | |||
129 | /* GL_EXT_gpu_shader4 / OpenGL 3.0 */ |
||
130 | SET_VertexAttribI1iEXT(tab, vfmt->VertexAttribI1i); |
||
131 | SET_VertexAttribI2iEXT(tab, vfmt->VertexAttribI2i); |
||
132 | SET_VertexAttribI3iEXT(tab, vfmt->VertexAttribI3i); |
||
133 | SET_VertexAttribI4iEXT(tab, vfmt->VertexAttribI4i); |
||
134 | SET_VertexAttribI2ivEXT(tab, vfmt->VertexAttribI2iv); |
||
135 | SET_VertexAttribI3ivEXT(tab, vfmt->VertexAttribI3iv); |
||
136 | SET_VertexAttribI4ivEXT(tab, vfmt->VertexAttribI4iv); |
||
137 | |||
138 | SET_VertexAttribI1uiEXT(tab, vfmt->VertexAttribI1ui); |
||
139 | SET_VertexAttribI2uiEXT(tab, vfmt->VertexAttribI2ui); |
||
140 | SET_VertexAttribI3uiEXT(tab, vfmt->VertexAttribI3ui); |
||
141 | SET_VertexAttribI4uiEXT(tab, vfmt->VertexAttribI4ui); |
||
142 | SET_VertexAttribI2uivEXT(tab, vfmt->VertexAttribI2uiv); |
||
143 | SET_VertexAttribI3uivEXT(tab, vfmt->VertexAttribI3uiv); |
||
144 | SET_VertexAttribI4uivEXT(tab, vfmt->VertexAttribI4uiv); |
||
145 | } |
||
146 | |||
147 | |||
148 | /** |
||
149 | * Install per-vertex functions into the API dispatch table for execution. |
||
150 | */ |
||
151 | void |
||
152 | _mesa_install_exec_vtxfmt(struct gl_context *ctx, const GLvertexformat *vfmt) |
||
153 | { |
||
154 | if (ctx->API == API_OPENGL) |
||
155 | install_vtxfmt( ctx->Exec, vfmt ); |
||
156 | } |
||
157 | |||
158 | |||
159 | /** |
||
160 | * Install per-vertex functions into the API dispatch table for display |
||
161 | * list compilation. |
||
162 | */ |
||
163 | void |
||
164 | _mesa_install_save_vtxfmt(struct gl_context *ctx, const GLvertexformat *vfmt) |
||
165 | { |
||
166 | if (ctx->API == API_OPENGL) |
||
167 | install_vtxfmt( ctx->Save, vfmt ); |
||
168 | } |
||
169 | |||
170 | |||
171 | #endif /* FEATURE_beginend */ |