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