[OPENGL32]
[reactos.git] / dll / opengl / opengl32 / glapi_x86.s
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS
4 * FILE: dll/opengl/opengl32/glapi_x86.s
5 * PURPOSE: OpenGL32 DLL
6 */
7
8 /* X86 opengl API entry points, fast forward to the current thread's dispatch table */
9 #include <asm.inc>
10 #include <ks386.inc>
11
12 .code
13
14 #ifdef OPENG32_USE_TLS
15 EXTERN _OglTlsIndex:DWORD
16 EXTERN _TlsGetValue@4:PROC
17
18 MACRO(USE_GL_FUNC, name, offset, stack)
19 PUBLIC _gl&name&@&stack
20 .PROC _gl&name&@&stack
21 push _OglTlsIndex
22 call _TlsGetValue@4
23 mov eax, [eax]
24 jmp dword ptr [eax+4*VAL(offset)]
25 .ENDP
26 ENDM
27 #else
28 MACRO(USE_GL_FUNC, name, offset, stack)
29 EXTERN _nop_&name@&stack:PROC
30 PUBLIC _gl&name&@&stack
31 .PROC _gl&name&@&stack
32 /* Get the TEB */
33 mov eax, fs:[TEB_SELF]
34 /* Get the GL table */
35 mov eax, [eax + TEB_GL_TABLE]
36 /* If we don't have a dispatch table, call the nop */
37 test eax, eax
38 jz _nop_&name&@&stack
39 /* Jump into the ICD */
40 jmp dword ptr [eax+4*VAL(offset)]
41 .ENDP
42 ENDM
43 #endif
44
45 USE_GL_FUNC Accum, 213, 8
46 USE_GL_FUNC AlphaFunc, 240, 8
47 USE_GL_FUNC AreTexturesResident, 322, 12
48 USE_GL_FUNC ArrayElement, 306, 4
49 USE_GL_FUNC Begin, 7, 4
50 USE_GL_FUNC BindTexture, 307, 8
51 USE_GL_FUNC Bitmap, 8, 28
52 USE_GL_FUNC BlendFunc, 241, 8
53 USE_GL_FUNC CallList, 2, 4
54 USE_GL_FUNC CallLists, 3, 12
55 USE_GL_FUNC Clear, 203, 4
56 USE_GL_FUNC ClearAccum, 204, 16
57 USE_GL_FUNC ClearColor, 206, 16
58 USE_GL_FUNC ClearDepth, 208, 8
59 USE_GL_FUNC ClearIndex, 205, 4
60 USE_GL_FUNC ClearStencil, 207, 4
61 USE_GL_FUNC ClipPlane, 150, 8
62 USE_GL_FUNC Color3b, 9, 12
63 USE_GL_FUNC Color3bv, 10, 4
64 USE_GL_FUNC Color3d, 11, 24
65 USE_GL_FUNC Color3dv, 12, 4
66 USE_GL_FUNC Color3f, 13, 12
67 USE_GL_FUNC Color3fv, 14, 4
68 USE_GL_FUNC Color3i, 15, 12
69 USE_GL_FUNC Color3iv, 16, 4
70 USE_GL_FUNC Color3s, 17, 12
71 USE_GL_FUNC Color3sv, 18, 4
72 USE_GL_FUNC Color3ub, 19, 12
73 USE_GL_FUNC Color3ubv, 20, 4
74 USE_GL_FUNC Color3ui, 21, 12
75 USE_GL_FUNC Color3uiv, 22, 4
76 USE_GL_FUNC Color3us, 23, 12
77 USE_GL_FUNC Color3usv, 24, 4
78 USE_GL_FUNC Color4b, 25, 16
79 USE_GL_FUNC Color4bv, 26, 4
80 USE_GL_FUNC Color4d, 27, 32
81 USE_GL_FUNC Color4dv, 28, 4
82 USE_GL_FUNC Color4f, 29, 16
83 USE_GL_FUNC Color4fv, 30, 4
84 USE_GL_FUNC Color4i, 31, 16
85 USE_GL_FUNC Color4iv, 32, 4
86 USE_GL_FUNC Color4s, 33, 16
87 USE_GL_FUNC Color4sv, 34, 4
88 USE_GL_FUNC Color4ub, 35, 16
89 USE_GL_FUNC Color4ubv, 36, 4
90 USE_GL_FUNC Color4ui, 37, 16
91 USE_GL_FUNC Color4uiv, 38, 4
92 USE_GL_FUNC Color4us, 39, 16
93 USE_GL_FUNC Color4usv, 40, 4
94 USE_GL_FUNC ColorMask, 210, 16
95 USE_GL_FUNC ColorMaterial, 151, 8
96 USE_GL_FUNC ColorPointer, 308, 16
97 USE_GL_FUNC CopyPixels, 255, 20
98 USE_GL_FUNC CopyTexImage1D, 323, 28
99 USE_GL_FUNC CopyTexImage2D, 324, 32
100 USE_GL_FUNC CopyTexSubImage1D, 325, 24
101 USE_GL_FUNC CopyTexSubImage2D, 326, 32
102 USE_GL_FUNC CullFace, 152, 4
103 USE_GL_FUNC DeleteLists, 4, 8
104 USE_GL_FUNC DeleteTextures, 327, 8
105 USE_GL_FUNC DepthFunc, 245, 4
106 USE_GL_FUNC DepthMask, 211, 4
107 USE_GL_FUNC DepthRange, 288, 16
108 USE_GL_FUNC Disable, 214, 4
109 USE_GL_FUNC DisableClientState, 309, 4
110 USE_GL_FUNC DrawArrays, 310, 12
111 USE_GL_FUNC DrawBuffer, 202, 4
112 USE_GL_FUNC DrawElements, 311, 16
113 USE_GL_FUNC DrawPixels, 257, 20
114 USE_GL_FUNC EdgeFlag, 41, 4
115 USE_GL_FUNC EdgeFlagPointer, 312, 8
116 USE_GL_FUNC EdgeFlagv, 42, 4
117 USE_GL_FUNC Enable, 215, 4
118 USE_GL_FUNC EnableClientState, 313, 4
119 USE_GL_FUNC End, 43, 0
120 USE_GL_FUNC EndList, 1, 0
121 USE_GL_FUNC EvalCoord1d, 228, 8
122 USE_GL_FUNC EvalCoord1dv, 229, 4
123 USE_GL_FUNC EvalCoord1f, 230, 4
124 USE_GL_FUNC EvalCoord1fv, 231, 4
125 USE_GL_FUNC EvalCoord2d, 232, 16
126 USE_GL_FUNC EvalCoord2dv, 233, 4
127 USE_GL_FUNC EvalCoord2f, 234, 8
128 USE_GL_FUNC EvalCoord2fv, 235, 4
129 USE_GL_FUNC EvalMesh1, 236, 12
130 USE_GL_FUNC EvalMesh2, 238, 20
131 USE_GL_FUNC EvalPoint1, 237, 4
132 USE_GL_FUNC EvalPoint2, 239, 8
133 USE_GL_FUNC FeedbackBuffer, 194, 12
134 USE_GL_FUNC Finish, 216, 0
135 USE_GL_FUNC Flush, 217, 0
136 USE_GL_FUNC Fogf, 153, 8
137 USE_GL_FUNC Fogfv, 154, 8
138 USE_GL_FUNC Fogi, 155, 8
139 USE_GL_FUNC Fogiv, 156, 8
140 USE_GL_FUNC FrontFace, 157, 4
141 USE_GL_FUNC Frustum, 289, 48
142 USE_GL_FUNC GenLists, 5, 4
143 USE_GL_FUNC GenTextures, 328, 8
144 USE_GL_FUNC GetBooleanv, 258, 8
145 USE_GL_FUNC GetClipPlane, 259, 8
146 USE_GL_FUNC GetDoublev, 260, 8
147 USE_GL_FUNC GetError, 261, 0
148 USE_GL_FUNC GetFloatv, 262, 8
149 USE_GL_FUNC GetIntegerv, 263, 8
150 USE_GL_FUNC GetLightfv, 264, 12
151 USE_GL_FUNC GetLightiv, 265, 12
152 USE_GL_FUNC GetMapdv, 266, 12
153 USE_GL_FUNC GetMapfv, 267, 12
154 USE_GL_FUNC GetMapiv, 268, 12
155 USE_GL_FUNC GetMaterialfv, 269, 12
156 USE_GL_FUNC GetMaterialiv, 270, 12
157 USE_GL_FUNC GetPixelMapfv, 271, 8
158 USE_GL_FUNC GetPixelMapuiv, 272, 8
159 USE_GL_FUNC GetPixelMapusv, 273, 8
160 USE_GL_FUNC GetPointerv, 329, 8
161 USE_GL_FUNC GetPolygonStipple, 274, 4
162 USE_GL_FUNC GetString, 275, 4
163 USE_GL_FUNC GetTexEnvfv, 276, 12
164 USE_GL_FUNC GetTexEnviv, 277, 12
165 USE_GL_FUNC GetTexGendv, 278, 12
166 USE_GL_FUNC GetTexGenfv, 279, 12
167 USE_GL_FUNC GetTexGeniv, 280, 12
168 USE_GL_FUNC GetTexImage, 281, 20
169 USE_GL_FUNC GetTexLevelParameterfv, 284, 16
170 USE_GL_FUNC GetTexLevelParameteriv, 285, 16
171 USE_GL_FUNC GetTexParameterfv, 282, 12
172 USE_GL_FUNC GetTexParameteriv, 283, 12
173 USE_GL_FUNC Hint, 158, 8
174 USE_GL_FUNC IndexMask, 212, 4
175 USE_GL_FUNC IndexPointer, 314, 12
176 USE_GL_FUNC Indexd, 44, 8
177 USE_GL_FUNC Indexdv, 45, 4
178 USE_GL_FUNC Indexf, 46, 4
179 USE_GL_FUNC Indexfv, 47, 4
180 USE_GL_FUNC Indexi, 48, 4
181 USE_GL_FUNC Indexiv, 49, 4
182 USE_GL_FUNC Indexs, 50, 4
183 USE_GL_FUNC Indexsv, 51, 4
184 USE_GL_FUNC Indexub, 315, 4
185 USE_GL_FUNC Indexubv, 316, 4
186 USE_GL_FUNC InitNames, 197, 0
187 USE_GL_FUNC InterleavedArrays, 317, 12
188 USE_GL_FUNC IsEnabled, 286, 4
189 USE_GL_FUNC IsList, 287, 4
190 USE_GL_FUNC IsTexture, 330, 4
191 USE_GL_FUNC LightModelf, 163, 8
192 USE_GL_FUNC LightModelfv, 164, 8
193 USE_GL_FUNC LightModeli, 165, 8
194 USE_GL_FUNC LightModeliv, 166, 8
195 USE_GL_FUNC Lightf, 159, 12
196 USE_GL_FUNC Lightfv, 160, 12
197 USE_GL_FUNC Lighti, 161, 12
198 USE_GL_FUNC Lightiv, 162, 12
199 USE_GL_FUNC LineStipple, 167, 8
200 USE_GL_FUNC LineWidth, 168, 4
201 USE_GL_FUNC ListBase, 6, 4
202 USE_GL_FUNC LoadIdentity, 290, 0
203 USE_GL_FUNC LoadMatrixd, 292, 4
204 USE_GL_FUNC LoadMatrixf, 291, 4
205 USE_GL_FUNC LoadName, 198, 4
206 USE_GL_FUNC LogicOp, 242, 4
207 USE_GL_FUNC Map1d, 220, 32
208 USE_GL_FUNC Map1f, 221, 24
209 USE_GL_FUNC Map2d, 222, 56
210 USE_GL_FUNC Map2f, 223, 40
211 USE_GL_FUNC MapGrid1d, 224, 20
212 USE_GL_FUNC MapGrid1f, 225, 12
213 USE_GL_FUNC MapGrid2d, 226, 40
214 USE_GL_FUNC MapGrid2f, 227, 24
215 USE_GL_FUNC Materialf, 169, 12
216 USE_GL_FUNC Materialfv, 170, 12
217 USE_GL_FUNC Materiali, 171, 12
218 USE_GL_FUNC Materialiv, 172, 12
219 USE_GL_FUNC MatrixMode, 293, 4
220 USE_GL_FUNC MultMatrixd, 295, 4
221 USE_GL_FUNC MultMatrixf, 294, 4
222 USE_GL_FUNC NewList, 0, 8
223 USE_GL_FUNC Normal3b, 52, 12
224 USE_GL_FUNC Normal3bv, 53, 4
225 USE_GL_FUNC Normal3d, 54, 24
226 USE_GL_FUNC Normal3dv, 55, 4
227 USE_GL_FUNC Normal3f, 56, 12
228 USE_GL_FUNC Normal3fv, 57, 4
229 USE_GL_FUNC Normal3i, 58, 12
230 USE_GL_FUNC Normal3iv, 59, 4
231 USE_GL_FUNC Normal3s, 60, 12
232 USE_GL_FUNC Normal3sv, 61, 4
233 USE_GL_FUNC NormalPointer, 318, 12
234 USE_GL_FUNC Ortho, 296, 48
235 USE_GL_FUNC PassThrough, 199, 4
236 USE_GL_FUNC PixelMapfv, 251, 12
237 USE_GL_FUNC PixelMapuiv, 252, 12
238 USE_GL_FUNC PixelMapusv, 253, 12
239 USE_GL_FUNC PixelStoref, 249, 8
240 USE_GL_FUNC PixelStorei, 250, 8
241 USE_GL_FUNC PixelTransferf, 247, 8
242 USE_GL_FUNC PixelTransferi, 248, 8
243 USE_GL_FUNC PixelZoom, 246, 8
244 USE_GL_FUNC PointSize, 173, 4
245 USE_GL_FUNC PolygonMode, 174, 8
246 USE_GL_FUNC PolygonOffset, 319, 8
247 USE_GL_FUNC PolygonStipple, 175, 4
248 USE_GL_FUNC PopAttrib, 218, 0
249 USE_GL_FUNC PopClientAttrib, 334, 0
250 USE_GL_FUNC PopMatrix, 297, 0
251 USE_GL_FUNC PopName, 200, 0
252 USE_GL_FUNC PrioritizeTextures, 331, 12
253 USE_GL_FUNC PushAttrib, 219, 4
254 USE_GL_FUNC PushClientAttrib, 335, 4
255 USE_GL_FUNC PushMatrix, 298, 0
256 USE_GL_FUNC PushName, 201, 4
257 USE_GL_FUNC RasterPos2d, 62, 16
258 USE_GL_FUNC RasterPos2dv, 63, 4
259 USE_GL_FUNC RasterPos2f, 64, 8
260 USE_GL_FUNC RasterPos2fv, 65, 4
261 USE_GL_FUNC RasterPos2i, 66, 8
262 USE_GL_FUNC RasterPos2iv, 67, 4
263 USE_GL_FUNC RasterPos2s, 68, 8
264 USE_GL_FUNC RasterPos2sv, 69, 4
265 USE_GL_FUNC RasterPos3d, 70, 24
266 USE_GL_FUNC RasterPos3dv, 71, 4
267 USE_GL_FUNC RasterPos3f, 72, 12
268 USE_GL_FUNC RasterPos3fv, 73, 4
269 USE_GL_FUNC RasterPos3i, 74, 12
270 USE_GL_FUNC RasterPos3iv, 75, 4
271 USE_GL_FUNC RasterPos3s, 76, 12
272 USE_GL_FUNC RasterPos3sv, 77, 4
273 USE_GL_FUNC RasterPos4d, 78, 32
274 USE_GL_FUNC RasterPos4dv, 79, 4
275 USE_GL_FUNC RasterPos4f, 80, 16
276 USE_GL_FUNC RasterPos4fv, 81, 4
277 USE_GL_FUNC RasterPos4i, 82, 16
278 USE_GL_FUNC RasterPos4iv, 83, 4
279 USE_GL_FUNC RasterPos4s, 84, 16
280 USE_GL_FUNC RasterPos4sv, 85, 4
281 USE_GL_FUNC ReadBuffer, 254, 4
282 USE_GL_FUNC ReadPixels, 256, 28
283 USE_GL_FUNC Rectd, 86, 32
284 USE_GL_FUNC Rectdv, 87, 8
285 USE_GL_FUNC Rectf, 88, 16
286 USE_GL_FUNC Rectfv, 89, 8
287 USE_GL_FUNC Recti, 90, 16
288 USE_GL_FUNC Rectiv, 91, 8
289 USE_GL_FUNC Rects, 92, 16
290 USE_GL_FUNC Rectsv, 93, 8
291 USE_GL_FUNC RenderMode, 196, 4
292 USE_GL_FUNC Rotated, 299, 32
293 USE_GL_FUNC Rotatef, 300, 16
294 USE_GL_FUNC Scaled, 301, 24
295 USE_GL_FUNC Scalef, 302, 12
296 USE_GL_FUNC Scissor, 176, 16
297 USE_GL_FUNC SelectBuffer, 195, 8
298 USE_GL_FUNC ShadeModel, 177, 4
299 USE_GL_FUNC StencilFunc, 243, 12
300 USE_GL_FUNC StencilMask, 209, 4
301 USE_GL_FUNC StencilOp, 244, 12
302 USE_GL_FUNC TexCoord1d, 94, 8
303 USE_GL_FUNC TexCoord1dv, 95, 4
304 USE_GL_FUNC TexCoord1f, 96, 4
305 USE_GL_FUNC TexCoord1fv, 97, 4
306 USE_GL_FUNC TexCoord1i, 98, 4
307 USE_GL_FUNC TexCoord1iv, 99, 4
308 USE_GL_FUNC TexCoord1s, 100, 4
309 USE_GL_FUNC TexCoord1sv, 101, 4
310 USE_GL_FUNC TexCoord2d, 102, 16
311 USE_GL_FUNC TexCoord2dv, 103, 4
312 USE_GL_FUNC TexCoord2f, 104, 8
313 USE_GL_FUNC TexCoord2fv, 105, 4
314 USE_GL_FUNC TexCoord2i, 106, 8
315 USE_GL_FUNC TexCoord2iv, 107, 4
316 USE_GL_FUNC TexCoord2s, 108, 8
317 USE_GL_FUNC TexCoord2sv, 109, 4
318 USE_GL_FUNC TexCoord3d, 110, 24
319 USE_GL_FUNC TexCoord3dv, 111, 4
320 USE_GL_FUNC TexCoord3f, 112, 12
321 USE_GL_FUNC TexCoord3fv, 113, 4
322 USE_GL_FUNC TexCoord3i, 114, 12
323 USE_GL_FUNC TexCoord3iv, 115, 4
324 USE_GL_FUNC TexCoord3s, 116, 12
325 USE_GL_FUNC TexCoord3sv, 117, 4
326 USE_GL_FUNC TexCoord4d, 118, 32
327 USE_GL_FUNC TexCoord4dv, 119, 4
328 USE_GL_FUNC TexCoord4f, 120, 16
329 USE_GL_FUNC TexCoord4fv, 121, 4
330 USE_GL_FUNC TexCoord4i, 122, 16
331 USE_GL_FUNC TexCoord4iv, 123, 4
332 USE_GL_FUNC TexCoord4s, 124, 16
333 USE_GL_FUNC TexCoord4sv, 125, 4
334 USE_GL_FUNC TexCoordPointer, 320, 16
335 USE_GL_FUNC TexEnvf, 184, 12
336 USE_GL_FUNC TexEnvfv, 185, 12
337 USE_GL_FUNC TexEnvi, 186, 12
338 USE_GL_FUNC TexEnviv, 187, 12
339 USE_GL_FUNC TexGend, 188, 16
340 USE_GL_FUNC TexGendv, 189, 12
341 USE_GL_FUNC TexGenf, 190, 12
342 USE_GL_FUNC TexGenfv, 191, 12
343 USE_GL_FUNC TexGeni, 192, 12
344 USE_GL_FUNC TexGeniv, 193, 12
345 USE_GL_FUNC TexImage1D, 182, 32
346 USE_GL_FUNC TexImage2D, 183, 36
347 USE_GL_FUNC TexParameterf, 178, 12
348 USE_GL_FUNC TexParameterfv, 179, 12
349 USE_GL_FUNC TexParameteri, 180, 12
350 USE_GL_FUNC TexParameteriv, 181, 12
351 USE_GL_FUNC TexSubImage1D, 332, 28
352 USE_GL_FUNC TexSubImage2D, 333, 36
353 USE_GL_FUNC Translated, 303, 24
354 USE_GL_FUNC Translatef, 304, 12
355 USE_GL_FUNC Vertex2d, 126, 16
356 USE_GL_FUNC Vertex2dv, 127, 4
357 USE_GL_FUNC Vertex2f, 128, 8
358 USE_GL_FUNC Vertex2fv, 129, 4
359 USE_GL_FUNC Vertex2i, 130, 8
360 USE_GL_FUNC Vertex2iv, 131, 4
361 USE_GL_FUNC Vertex2s, 132, 8
362 USE_GL_FUNC Vertex2sv, 133, 4
363 USE_GL_FUNC Vertex3d, 134, 24
364 USE_GL_FUNC Vertex3dv, 135, 4
365 USE_GL_FUNC Vertex3f, 136, 12
366 USE_GL_FUNC Vertex3fv, 137, 4
367 USE_GL_FUNC Vertex3i, 138, 12
368 USE_GL_FUNC Vertex3iv, 139, 4
369 USE_GL_FUNC Vertex3s, 140, 12
370 USE_GL_FUNC Vertex3sv, 141, 4
371 USE_GL_FUNC Vertex4d, 142, 32
372 USE_GL_FUNC Vertex4dv, 143, 4
373 USE_GL_FUNC Vertex4f, 144, 16
374 USE_GL_FUNC Vertex4fv, 145, 4
375 USE_GL_FUNC Vertex4i, 146, 16
376 USE_GL_FUNC Vertex4iv, 147, 4
377 USE_GL_FUNC Vertex4s, 148, 16
378 USE_GL_FUNC Vertex4sv, 149, 4
379 USE_GL_FUNC VertexPointer, 321, 16
380 USE_GL_FUNC Viewport, 305, 16
381
382 END