]> git.cworth.org Git - apitrace/blob - glretrace_wgl.cpp
Qt not QT
[apitrace] / glretrace_wgl.cpp
1 /**************************************************************************
2  *
3  * Copyright 2011 Jose Fonseca
4  * All Rights Reserved.
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a copy
7  * of this software and associated documentation files (the "Software"), to deal
8  * in the Software without restriction, including without limitation the rights
9  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10  * copies of the Software, and to permit persons to whom the Software is
11  * furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in
14  * all copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22  * THE SOFTWARE.
23  *
24  **************************************************************************/
25
26
27 #include "glproc.hpp"
28 #include "retrace.hpp"
29 #include "glretrace.hpp"
30
31
32 using namespace glretrace;
33
34
35 typedef std::map<unsigned long long, glws::Drawable *> DrawableMap;
36 typedef std::map<unsigned long long, glws::Context *> ContextMap;
37 static DrawableMap drawable_map;
38 static DrawableMap pbuffer_map;
39 static ContextMap context_map;
40
41
42 static glws::Drawable *
43 getDrawable(unsigned long long hdc) {
44     if (hdc == 0) {
45         return NULL;
46     }
47
48     DrawableMap::const_iterator it;
49     it = drawable_map.find(hdc);
50     if (it == drawable_map.end()) {
51         return (drawable_map[hdc] = ws->createDrawable(visual));
52     }
53
54     return it->second;
55 }
56
57 static void retrace_wglCreateContext(Trace::Call &call) {
58     unsigned long long orig_context = call.ret->toUIntPtr();
59     glws::Context *context = ws->createContext(glretrace::visual);
60     context_map[orig_context] = context;
61 }
62
63 static void retrace_wglDeleteContext(Trace::Call &call) {
64 }
65
66 static void retrace_wglMakeCurrent(Trace::Call &call) {
67     if (drawable && context) {
68         glFlush();
69         if (!double_buffer) {
70             frame_complete(call.no);
71         }
72     }
73     
74     glws::Drawable *new_drawable = getDrawable(call.arg(0).toUIntPtr());
75     glws::Context *new_context = context_map[call.arg(1).toUIntPtr()];
76
77     bool result = ws->makeCurrent(new_drawable, new_context);
78
79     if (new_drawable && new_context && result) {
80         drawable = new_drawable;
81         context = new_context;
82     } else {
83         drawable = NULL;
84         context = NULL;
85     }
86 }
87
88 static void retrace_wglCopyContext(Trace::Call &call) {
89 }
90
91 static void retrace_wglChoosePixelFormat(Trace::Call &call) {
92 }
93
94 static void retrace_wglDescribePixelFormat(Trace::Call &call) {
95 }
96
97 static void retrace_wglSetPixelFormat(Trace::Call &call) {
98 }
99
100 static void retrace_wglSwapBuffers(Trace::Call &call) {
101     frame_complete(call.no);
102     if (double_buffer) {
103         drawable->swapBuffers();
104     } else {
105         glFlush();
106     }
107 }
108
109 static void retrace_wglShareLists(Trace::Call &call) {
110     unsigned long long hglrc1 = call.arg(0).toUIntPtr();
111     unsigned long long hglrc2 = call.arg(1).toUIntPtr();
112
113     glws::Context *share_context = context_map[hglrc1];
114     glws::Context *old_context = context_map[hglrc2];
115
116     glws::Context *new_context =
117         ws->createContext(old_context->visual, share_context);
118     if (new_context) {
119         delete old_context;
120         context_map[hglrc2] = new_context;
121     }
122 }
123
124 static void retrace_wglCreateLayerContext(Trace::Call &call) {
125     retrace_wglCreateContext(call);
126 }
127
128 static void retrace_wglDescribeLayerPlane(Trace::Call &call) {
129 }
130
131 static void retrace_wglSetLayerPaletteEntries(Trace::Call &call) {
132 }
133
134 static void retrace_wglRealizeLayerPalette(Trace::Call &call) {
135 }
136
137 static void retrace_wglSwapLayerBuffers(Trace::Call &call) {
138     retrace_wglSwapBuffers(call);
139 }
140
141 static void retrace_wglUseFontBitmapsA(Trace::Call &call) {
142 }
143
144 static void retrace_wglUseFontBitmapsW(Trace::Call &call) {
145 }
146
147 static void retrace_wglSwapMultipleBuffers(Trace::Call &call) {
148 }
149
150 static void retrace_wglUseFontOutlinesA(Trace::Call &call) {
151 }
152
153 static void retrace_wglUseFontOutlinesW(Trace::Call &call) {
154 }
155
156 static void retrace_wglCreateBufferRegionARB(Trace::Call &call) {
157 }
158
159 static void retrace_wglDeleteBufferRegionARB(Trace::Call &call) {
160 }
161
162 static void retrace_wglSaveBufferRegionARB(Trace::Call &call) {
163 }
164
165 static void retrace_wglRestoreBufferRegionARB(Trace::Call &call) {
166 }
167
168 static void retrace_wglChoosePixelFormatARB(Trace::Call &call) {
169 }
170
171 static void retrace_wglMakeContextCurrentARB(Trace::Call &call) {
172 }
173
174 static void retrace_wglCreatePbufferARB(Trace::Call &call) {
175     int iWidth = call.arg(2).toUInt();
176     int iHeight = call.arg(3).toUInt();
177
178     unsigned long long orig_pbuffer = call.ret->toUIntPtr();
179     glws::Drawable *drawable = ws->createDrawable(glretrace::visual);
180
181     drawable->resize(iWidth, iHeight);
182
183     pbuffer_map[orig_pbuffer] = drawable;
184 }
185
186 static void retrace_wglGetPbufferDCARB(Trace::Call &call) {
187     glws::Drawable *pbuffer = pbuffer_map[call.arg(0).toUIntPtr()];
188
189     unsigned long long orig_hdc = call.ret->toUIntPtr();
190
191     drawable_map[orig_hdc] = pbuffer;
192 }
193
194 static void retrace_wglReleasePbufferDCARB(Trace::Call &call) {
195 }
196
197 static void retrace_wglDestroyPbufferARB(Trace::Call &call) {
198 }
199
200 static void retrace_wglQueryPbufferARB(Trace::Call &call) {
201 }
202
203 static void retrace_wglBindTexImageARB(Trace::Call &call) {
204 }
205
206 static void retrace_wglReleaseTexImageARB(Trace::Call &call) {
207 }
208
209 static void retrace_wglSetPbufferAttribARB(Trace::Call &call) {
210 }
211
212 static void retrace_wglCreateContextAttribsARB(Trace::Call &call) {
213     unsigned long long orig_context = call.ret->toUIntPtr();
214     glws::Context *share_context = NULL;
215
216     if (call.arg(1).toPointer()) {
217         share_context = context_map[call.arg(1).toUIntPtr()];
218     }
219
220     glws::Context *context = ws->createContext(glretrace::visual, share_context);
221     context_map[orig_context] = context;
222 }
223
224 static void retrace_wglMakeContextCurrentEXT(Trace::Call &call) {
225 }
226
227 static void retrace_wglChoosePixelFormatEXT(Trace::Call &call) {
228 }
229
230 static void retrace_wglSwapIntervalEXT(Trace::Call &call) {
231 }
232
233 static void retrace_wglAllocateMemoryNV(Trace::Call &call) {
234 }
235
236 static void retrace_wglFreeMemoryNV(Trace::Call &call) {
237 }
238
239 static void retrace_glAddSwapHintRectWIN(Trace::Call &call) {
240 }
241
242 static void retrace_wglGetProcAddress(Trace::Call &call) {
243 }
244
245 void glretrace::retrace_call_wgl(Trace::Call &call) {
246     const char *name = call.name();
247
248     switch (name[0]) {
249     case 'g':
250         if (name[1] == 'l' && name[2] == 'A' && name[3] == 'd' && name[4] == 'd' && name[5] == 'S' && name[6] == 'w' && name[7] == 'a' && name[8] == 'p' && name[9] == 'H' && name[10] == 'i' && name[11] == 'n' && name[12] == 't' && name[13] == 'R' && name[14] == 'e' && name[15] == 'c' && name[16] == 't' && name[17] == 'W' && name[18] == 'I' && name[19] == 'N' && name[20] == '\0') {
251             // glAddSwapHintRectWIN
252             retrace_glAddSwapHintRectWIN(call);
253             return;
254         }
255         break;
256     case 'w':
257         switch (name[1]) {
258         case 'g':
259             switch (name[2]) {
260             case 'l':
261                 switch (name[3]) {
262                 case 'A':
263                     if (name[4] == 'l' && name[5] == 'l' && name[6] == 'o' && name[7] == 'c' && name[8] == 'a' && name[9] == 't' && name[10] == 'e' && name[11] == 'M' && name[12] == 'e' && name[13] == 'm' && name[14] == 'o' && name[15] == 'r' && name[16] == 'y' && name[17] == 'N' && name[18] == 'V' && name[19] == '\0') {
264                         // wglAllocateMemoryNV
265                         retrace_wglAllocateMemoryNV(call);
266                         return;
267                     }
268                     break;
269                 case 'B':
270                     if (name[4] == 'i' && name[5] == 'n' && name[6] == 'd' && name[7] == 'T' && name[8] == 'e' && name[9] == 'x' && name[10] == 'I' && name[11] == 'm' && name[12] == 'a' && name[13] == 'g' && name[14] == 'e' && name[15] == 'A' && name[16] == 'R' && name[17] == 'B' && name[18] == '\0') {
271                         // wglBindTexImageARB
272                         retrace_wglBindTexImageARB(call);
273                         return;
274                     }
275                     break;
276                 case 'C':
277                     switch (name[4]) {
278                     case 'h':
279                         switch (name[5]) {
280                         case 'o':
281                             switch (name[6]) {
282                             case 'o':
283                                 switch (name[7]) {
284                                 case 's':
285                                     switch (name[8]) {
286                                     case 'e':
287                                         switch (name[9]) {
288                                         case 'P':
289                                             switch (name[10]) {
290                                             case 'i':
291                                                 switch (name[11]) {
292                                                 case 'x':
293                                                     switch (name[12]) {
294                                                     case 'e':
295                                                         switch (name[13]) {
296                                                         case 'l':
297                                                             switch (name[14]) {
298                                                             case 'F':
299                                                                 switch (name[15]) {
300                                                                 case 'o':
301                                                                     switch (name[16]) {
302                                                                     case 'r':
303                                                                         switch (name[17]) {
304                                                                         case 'm':
305                                                                             switch (name[18]) {
306                                                                             case 'a':
307                                                                                 switch (name[19]) {
308                                                                                 case 't':
309                                                                                     switch (name[20]) {
310                                                                                     case '\0':
311                                                                                         // wglChoosePixelFormat
312                                                                                         retrace_wglChoosePixelFormat(call);
313                                                                                         return;
314                                                                                         break;
315                                                                                     case 'A':
316                                                                                         if (name[21] == 'R' && name[22] == 'B' && name[23] == '\0') {
317                                                                                             // wglChoosePixelFormatARB
318                                                                                             retrace_wglChoosePixelFormatARB(call);
319                                                                                             return;
320                                                                                         }
321                                                                                         break;
322                                                                                     case 'E':
323                                                                                         if (name[21] == 'X' && name[22] == 'T' && name[23] == '\0') {
324                                                                                             // wglChoosePixelFormatEXT
325                                                                                             retrace_wglChoosePixelFormatEXT(call);
326                                                                                             return;
327                                                                                         }
328                                                                                         break;
329                                                                                     }
330                                                                                     break;
331                                                                                 }
332                                                                                 break;
333                                                                             }
334                                                                             break;
335                                                                         }
336                                                                         break;
337                                                                     }
338                                                                     break;
339                                                                 }
340                                                                 break;
341                                                             }
342                                                             break;
343                                                         }
344                                                         break;
345                                                     }
346                                                     break;
347                                                 }
348                                                 break;
349                                             }
350                                             break;
351                                         }
352                                         break;
353                                     }
354                                     break;
355                                 }
356                                 break;
357                             }
358                             break;
359                         }
360                         break;
361                     case 'o':
362                         if (name[5] == 'p' && name[6] == 'y' && name[7] == 'C' && name[8] == 'o' && name[9] == 'n' && name[10] == 't' && name[11] == 'e' && name[12] == 'x' && name[13] == 't' && name[14] == '\0') {
363                             // wglCopyContext
364                             retrace_wglCopyContext(call);
365                             return;
366                         }
367                         break;
368                     case 'r':
369                         switch (name[5]) {
370                         case 'e':
371                             switch (name[6]) {
372                             case 'a':
373                                 switch (name[7]) {
374                                 case 't':
375                                     switch (name[8]) {
376                                     case 'e':
377                                         switch (name[9]) {
378                                         case 'B':
379                                             if (name[10] == 'u' && name[11] == 'f' && name[12] == 'f' && name[13] == 'e' && name[14] == 'r' && name[15] == 'R' && name[16] == 'e' && name[17] == 'g' && name[18] == 'i' && name[19] == 'o' && name[20] == 'n' && name[21] == 'A' && name[22] == 'R' && name[23] == 'B' && name[24] == '\0') {
380                                                 // wglCreateBufferRegionARB
381                                                 retrace_wglCreateBufferRegionARB(call);
382                                                 return;
383                                             }
384                                             break;
385                                         case 'C':
386                                             switch (name[10]) {
387                                             case 'o':
388                                                 switch (name[11]) {
389                                                 case 'n':
390                                                     switch (name[12]) {
391                                                     case 't':
392                                                         switch (name[13]) {
393                                                         case 'e':
394                                                             switch (name[14]) {
395                                                             case 'x':
396                                                                 switch (name[15]) {
397                                                                 case 't':
398                                                                     switch (name[16]) {
399                                                                     case '\0':
400                                                                         // wglCreateContext
401                                                                         retrace_wglCreateContext(call);
402                                                                         return;
403                                                                         break;
404                                                                     case 'A':
405                                                                         if (name[17] == 't' && name[18] == 't' && name[19] == 'r' && name[20] == 'i' && name[21] == 'b' && name[22] == 's' && name[23] == 'A' && name[24] == 'R' && name[25] == 'B' && name[26] == '\0') {
406                                                                             // wglCreateContextAttribsARB
407                                                                             retrace_wglCreateContextAttribsARB(call);
408                                                                             return;
409                                                                         }
410                                                                         break;
411                                                                     }
412                                                                     break;
413                                                                 }
414                                                                 break;
415                                                             }
416                                                             break;
417                                                         }
418                                                         break;
419                                                     }
420                                                     break;
421                                                 }
422                                                 break;
423                                             }
424                                             break;
425                                         case 'L':
426                                             if (name[10] == 'a' && name[11] == 'y' && name[12] == 'e' && name[13] == 'r' && name[14] == 'C' && name[15] == 'o' && name[16] == 'n' && name[17] == 't' && name[18] == 'e' && name[19] == 'x' && name[20] == 't' && name[21] == '\0') {
427                                                 // wglCreateLayerContext
428                                                 retrace_wglCreateLayerContext(call);
429                                                 return;
430                                             }
431                                             break;
432                                         case 'P':
433                                             if (name[10] == 'b' && name[11] == 'u' && name[12] == 'f' && name[13] == 'f' && name[14] == 'e' && name[15] == 'r' && name[16] == 'A' && name[17] == 'R' && name[18] == 'B' && name[19] == '\0') {
434                                                 // wglCreatePbufferARB
435                                                 retrace_wglCreatePbufferARB(call);
436                                                 return;
437                                             }
438                                             break;
439                                         }
440                                         break;
441                                     }
442                                     break;
443                                 }
444                                 break;
445                             }
446                             break;
447                         }
448                         break;
449                     }
450                     break;
451                 case 'D':
452                     switch (name[4]) {
453                     case 'e':
454                         switch (name[5]) {
455                         case 'l':
456                             switch (name[6]) {
457                             case 'e':
458                                 switch (name[7]) {
459                                 case 't':
460                                     switch (name[8]) {
461                                     case 'e':
462                                         switch (name[9]) {
463                                         case 'B':
464                                             if (name[10] == 'u' && name[11] == 'f' && name[12] == 'f' && name[13] == 'e' && name[14] == 'r' && name[15] == 'R' && name[16] == 'e' && name[17] == 'g' && name[18] == 'i' && name[19] == 'o' && name[20] == 'n' && name[21] == 'A' && name[22] == 'R' && name[23] == 'B' && name[24] == '\0') {
465                                                 // wglDeleteBufferRegionARB
466                                                 retrace_wglDeleteBufferRegionARB(call);
467                                                 return;
468                                             }
469                                             break;
470                                         case 'C':
471                                             if (name[10] == 'o' && name[11] == 'n' && name[12] == 't' && name[13] == 'e' && name[14] == 'x' && name[15] == 't' && name[16] == '\0') {
472                                                 // wglDeleteContext
473                                                 retrace_wglDeleteContext(call);
474                                                 return;
475                                             }
476                                             break;
477                                         }
478                                         break;
479                                     }
480                                     break;
481                                 }
482                                 break;
483                             }
484                             break;
485                         case 's':
486                             switch (name[6]) {
487                             case 'c':
488                                 switch (name[7]) {
489                                 case 'r':
490                                     switch (name[8]) {
491                                     case 'i':
492                                         switch (name[9]) {
493                                         case 'b':
494                                             switch (name[10]) {
495                                             case 'e':
496                                                 switch (name[11]) {
497                                                 case 'L':
498                                                     if (name[12] == 'a' && name[13] == 'y' && name[14] == 'e' && name[15] == 'r' && name[16] == 'P' && name[17] == 'l' && name[18] == 'a' && name[19] == 'n' && name[20] == 'e' && name[21] == '\0') {
499                                                         // wglDescribeLayerPlane
500                                                         retrace_wglDescribeLayerPlane(call);
501                                                         return;
502                                                     }
503                                                     break;
504                                                 case 'P':
505                                                     if (name[12] == 'i' && name[13] == 'x' && name[14] == 'e' && name[15] == 'l' && name[16] == 'F' && name[17] == 'o' && name[18] == 'r' && name[19] == 'm' && name[20] == 'a' && name[21] == 't' && name[22] == '\0') {
506                                                         // wglDescribePixelFormat
507                                                         retrace_wglDescribePixelFormat(call);
508                                                         return;
509                                                     }
510                                                     break;
511                                                 }
512                                                 break;
513                                             }
514                                             break;
515                                         }
516                                         break;
517                                     }
518                                     break;
519                                 }
520                                 break;
521                             case 't':
522                                 if (name[7] == 'r' && name[8] == 'o' && name[9] == 'y' && name[10] == 'P' && name[11] == 'b' && name[12] == 'u' && name[13] == 'f' && name[14] == 'f' && name[15] == 'e' && name[16] == 'r' && name[17] == 'A' && name[18] == 'R' && name[19] == 'B' && name[20] == '\0') {
523                                     // wglDestroyPbufferARB
524                                     retrace_wglDestroyPbufferARB(call);
525                                     return;
526                                 }
527                                 break;
528                             }
529                             break;
530                         }
531                         break;
532                     }
533                     break;
534                 case 'F':
535                     if (name[4] == 'r' && name[5] == 'e' && name[6] == 'e' && name[7] == 'M' && name[8] == 'e' && name[9] == 'm' && name[10] == 'o' && name[11] == 'r' && name[12] == 'y' && name[13] == 'N' && name[14] == 'V' && name[15] == '\0') {
536                         // wglFreeMemoryNV
537                         retrace_wglFreeMemoryNV(call);
538                         return;
539                     }
540                     break;
541                 case 'G':
542                     switch (name[4]) {
543                     case 'e':
544                         switch (name[5]) {
545                         case 't':
546                             switch (name[6]) {
547                             case 'C':
548                                 switch (name[7]) {
549                                 case 'u':
550                                     switch (name[8]) {
551                                     case 'r':
552                                         switch (name[9]) {
553                                         case 'r':
554                                             switch (name[10]) {
555                                             case 'e':
556                                                 switch (name[11]) {
557                                                 case 'n':
558                                                     switch (name[12]) {
559                                                     case 't':
560                                                         switch (name[13]) {
561                                                         case 'C':
562                                                             if (name[14] == 'o' && name[15] == 'n' && name[16] == 't' && name[17] == 'e' && name[18] == 'x' && name[19] == 't' && name[20] == '\0') {
563                                                                 // wglGetCurrentContext
564                                                                 return;
565                                                             }
566                                                             break;
567                                                         case 'D':
568                                                             if (name[14] == 'C' && name[15] == '\0') {
569                                                                 // wglGetCurrentDC
570                                                                 return;
571                                                             }
572                                                             break;
573                                                         case 'R':
574                                                             switch (name[14]) {
575                                                             case 'e':
576                                                                 switch (name[15]) {
577                                                                 case 'a':
578                                                                     switch (name[16]) {
579                                                                     case 'd':
580                                                                         switch (name[17]) {
581                                                                         case 'D':
582                                                                             switch (name[18]) {
583                                                                             case 'C':
584                                                                                 switch (name[19]) {
585                                                                                 case 'A':
586                                                                                     if (name[20] == 'R' && name[21] == 'B' && name[22] == '\0') {
587                                                                                         // wglGetCurrentReadDCARB
588                                                                                         return;
589                                                                                     }
590                                                                                     break;
591                                                                                 case 'E':
592                                                                                     if (name[20] == 'X' && name[21] == 'T' && name[22] == '\0') {
593                                                                                         // wglGetCurrentReadDCEXT
594                                                                                         return;
595                                                                                     }
596                                                                                     break;
597                                                                                 }
598                                                                                 break;
599                                                                             }
600                                                                             break;
601                                                                         }
602                                                                         break;
603                                                                     }
604                                                                     break;
605                                                                 }
606                                                                 break;
607                                                             }
608                                                             break;
609                                                         }
610                                                         break;
611                                                     }
612                                                     break;
613                                                 }
614                                                 break;
615                                             }
616                                             break;
617                                         }
618                                         break;
619                                     }
620                                     break;
621                                 }
622                                 break;
623                             case 'D':
624                                 if (name[7] == 'e' && name[8] == 'f' && name[9] == 'a' && name[10] == 'u' && name[11] == 'l' && name[12] == 't' && name[13] == 'P' && name[14] == 'r' && name[15] == 'o' && name[16] == 'c' && name[17] == 'A' && name[18] == 'd' && name[19] == 'd' && name[20] == 'r' && name[21] == 'e' && name[22] == 's' && name[23] == 's' && name[24] == '\0') {
625                                     // wglGetDefaultProcAddress
626                                     return;
627                                 }
628                                 break;
629                             case 'E':
630                                 switch (name[7]) {
631                                 case 'x':
632                                     switch (name[8]) {
633                                     case 't':
634                                         switch (name[9]) {
635                                         case 'e':
636                                             switch (name[10]) {
637                                             case 'n':
638                                                 switch (name[11]) {
639                                                 case 's':
640                                                     switch (name[12]) {
641                                                     case 'i':
642                                                         switch (name[13]) {
643                                                         case 'o':
644                                                             switch (name[14]) {
645                                                             case 'n':
646                                                                 switch (name[15]) {
647                                                                 case 's':
648                                                                     switch (name[16]) {
649                                                                     case 'S':
650                                                                         switch (name[17]) {
651                                                                         case 't':
652                                                                             switch (name[18]) {
653                                                                             case 'r':
654                                                                                 switch (name[19]) {
655                                                                                 case 'i':
656                                                                                     switch (name[20]) {
657                                                                                     case 'n':
658                                                                                         switch (name[21]) {
659                                                                                         case 'g':
660                                                                                             switch (name[22]) {
661                                                                                             case 'A':
662                                                                                                 if (name[23] == 'R' && name[24] == 'B' && name[25] == '\0') {
663                                                                                                     // wglGetExtensionsStringARB
664                                                                                                     return;
665                                                                                                 }
666                                                                                                 break;
667                                                                                             case 'E':
668                                                                                                 if (name[23] == 'X' && name[24] == 'T' && name[25] == '\0') {
669                                                                                                     // wglGetExtensionsStringEXT
670                                                                                                     return;
671                                                                                                 }
672                                                                                                 break;
673                                                                                             }
674                                                                                             break;
675                                                                                         }
676                                                                                         break;
677                                                                                     }
678                                                                                     break;
679                                                                                 }
680                                                                                 break;
681                                                                             }
682                                                                             break;
683                                                                         }
684                                                                         break;
685                                                                     }
686                                                                     break;
687                                                                 }
688                                                                 break;
689                                                             }
690                                                             break;
691                                                         }
692                                                         break;
693                                                     }
694                                                     break;
695                                                 }
696                                                 break;
697                                             }
698                                             break;
699                                         }
700                                         break;
701                                     }
702                                     break;
703                                 }
704                                 break;
705                             case 'L':
706                                 if (name[7] == 'a' && name[8] == 'y' && name[9] == 'e' && name[10] == 'r' && name[11] == 'P' && name[12] == 'a' && name[13] == 'l' && name[14] == 'e' && name[15] == 't' && name[16] == 't' && name[17] == 'e' && name[18] == 'E' && name[19] == 'n' && name[20] == 't' && name[21] == 'r' && name[22] == 'i' && name[23] == 'e' && name[24] == 's' && name[25] == '\0') {
707                                     // wglGetLayerPaletteEntries
708                                     return;
709                                 }
710                                 break;
711                             case 'P':
712                                 switch (name[7]) {
713                                 case 'b':
714                                     if (name[8] == 'u' && name[9] == 'f' && name[10] == 'f' && name[11] == 'e' && name[12] == 'r' && name[13] == 'D' && name[14] == 'C' && name[15] == 'A' && name[16] == 'R' && name[17] == 'B' && name[18] == '\0') {
715                                         // wglGetPbufferDCARB
716                                         retrace_wglGetPbufferDCARB(call);
717                                         return;
718                                     }
719                                     break;
720                                 case 'i':
721                                     switch (name[8]) {
722                                     case 'x':
723                                         switch (name[9]) {
724                                         case 'e':
725                                             switch (name[10]) {
726                                             case 'l':
727                                                 switch (name[11]) {
728                                                 case 'F':
729                                                     switch (name[12]) {
730                                                     case 'o':
731                                                         switch (name[13]) {
732                                                         case 'r':
733                                                             switch (name[14]) {
734                                                             case 'm':
735                                                                 switch (name[15]) {
736                                                                 case 'a':
737                                                                     switch (name[16]) {
738                                                                     case 't':
739                                                                         switch (name[17]) {
740                                                                         case '\0':
741                                                                             // wglGetPixelFormat
742                                                                             return;
743                                                                             break;
744                                                                         case 'A':
745                                                                             switch (name[18]) {
746                                                                             case 't':
747                                                                                 switch (name[19]) {
748                                                                                 case 't':
749                                                                                     switch (name[20]) {
750                                                                                     case 'r':
751                                                                                         switch (name[21]) {
752                                                                                         case 'i':
753                                                                                             switch (name[22]) {
754                                                                                             case 'b':
755                                                                                                 switch (name[23]) {
756                                                                                                 case 'f':
757                                                                                                     switch (name[24]) {
758                                                                                                     case 'v':
759                                                                                                         switch (name[25]) {
760                                                                                                         case 'A':
761                                                                                                             if (name[26] == 'R' && name[27] == 'B' && name[28] == '\0') {
762                                                                                                                 // wglGetPixelFormatAttribfvARB
763                                                                                                                 return;
764                                                                                                             }
765                                                                                                             break;
766                                                                                                         case 'E':
767                                                                                                             if (name[26] == 'X' && name[27] == 'T' && name[28] == '\0') {
768                                                                                                                 // wglGetPixelFormatAttribfvEXT
769                                                                                                                 return;
770                                                                                                             }
771                                                                                                             break;
772                                                                                                         }
773                                                                                                         break;
774                                                                                                     }
775                                                                                                     break;
776                                                                                                 case 'i':
777                                                                                                     switch (name[24]) {
778                                                                                                     case 'v':
779                                                                                                         switch (name[25]) {
780                                                                                                         case 'A':
781                                                                                                             if (name[26] == 'R' && name[27] == 'B' && name[28] == '\0') {
782                                                                                                                 // wglGetPixelFormatAttribivARB
783                                                                                                                 return;
784                                                                                                             }
785                                                                                                             break;
786                                                                                                         case 'E':
787                                                                                                             if (name[26] == 'X' && name[27] == 'T' && name[28] == '\0') {
788                                                                                                                 // wglGetPixelFormatAttribivEXT
789                                                                                                                 return;
790                                                                                                             }
791                                                                                                             break;
792                                                                                                         }
793                                                                                                         break;
794                                                                                                     }
795                                                                                                     break;
796                                                                                                 }
797                                                                                                 break;
798                                                                                             }
799                                                                                             break;
800                                                                                         }
801                                                                                         break;
802                                                                                     }
803                                                                                     break;
804                                                                                 }
805                                                                                 break;
806                                                                             }
807                                                                             break;
808                                                                         }
809                                                                         break;
810                                                                     }
811                                                                     break;
812                                                                 }
813                                                                 break;
814                                                             }
815                                                             break;
816                                                         }
817                                                         break;
818                                                     }
819                                                     break;
820                                                 }
821                                                 break;
822                                             }
823                                             break;
824                                         }
825                                         break;
826                                     }
827                                     break;
828                                 case 'r':
829                                     if (name[8] == 'o' && name[9] == 'c' && name[10] == 'A' && name[11] == 'd' && name[12] == 'd' && name[13] == 'r' && name[14] == 'e' && name[15] == 's' && name[16] == 's' && name[17] == '\0') {
830                                         // wglGetProcAddress
831                                         retrace_wglGetProcAddress(call);
832                                         return;
833                                     }
834                                     break;
835                                 }
836                                 break;
837                             case 'S':
838                                 if (name[7] == 'w' && name[8] == 'a' && name[9] == 'p' && name[10] == 'I' && name[11] == 'n' && name[12] == 't' && name[13] == 'e' && name[14] == 'r' && name[15] == 'v' && name[16] == 'a' && name[17] == 'l' && name[18] == 'E' && name[19] == 'X' && name[20] == 'T' && name[21] == '\0') {
839                                     // wglGetSwapIntervalEXT
840                                     return;
841                                 }
842                                 break;
843                             }
844                             break;
845                         }
846                         break;
847                     }
848                     break;
849                 case 'M':
850                     switch (name[4]) {
851                     case 'a':
852                         switch (name[5]) {
853                         case 'k':
854                             switch (name[6]) {
855                             case 'e':
856                                 switch (name[7]) {
857                                 case 'C':
858                                     switch (name[8]) {
859                                     case 'o':
860                                         switch (name[9]) {
861                                         case 'n':
862                                             switch (name[10]) {
863                                             case 't':
864                                                 switch (name[11]) {
865                                                 case 'e':
866                                                     switch (name[12]) {
867                                                     case 'x':
868                                                         switch (name[13]) {
869                                                         case 't':
870                                                             switch (name[14]) {
871                                                             case 'C':
872                                                                 switch (name[15]) {
873                                                                 case 'u':
874                                                                     switch (name[16]) {
875                                                                     case 'r':
876                                                                         switch (name[17]) {
877                                                                         case 'r':
878                                                                             switch (name[18]) {
879                                                                             case 'e':
880                                                                                 switch (name[19]) {
881                                                                                 case 'n':
882                                                                                     switch (name[20]) {
883                                                                                     case 't':
884                                                                                         switch (name[21]) {
885                                                                                         case 'A':
886                                                                                             if (name[22] == 'R' && name[23] == 'B' && name[24] == '\0') {
887                                                                                                 // wglMakeContextCurrentARB
888                                                                                                 retrace_wglMakeContextCurrentARB(call);
889                                                                                                 return;
890                                                                                             }
891                                                                                             break;
892                                                                                         case 'E':
893                                                                                             if (name[22] == 'X' && name[23] == 'T' && name[24] == '\0') {
894                                                                                                 // wglMakeContextCurrentEXT
895                                                                                                 retrace_wglMakeContextCurrentEXT(call);
896                                                                                                 return;
897                                                                                             }
898                                                                                             break;
899                                                                                         }
900                                                                                         break;
901                                                                                     }
902                                                                                     break;
903                                                                                 }
904                                                                                 break;
905                                                                             }
906                                                                             break;
907                                                                         }
908                                                                         break;
909                                                                     }
910                                                                     break;
911                                                                 }
912                                                                 break;
913                                                             }
914                                                             break;
915                                                         }
916                                                         break;
917                                                     }
918                                                     break;
919                                                 }
920                                                 break;
921                                             }
922                                             break;
923                                         }
924                                         break;
925                                     case 'u':
926                                         if (name[9] == 'r' && name[10] == 'r' && name[11] == 'e' && name[12] == 'n' && name[13] == 't' && name[14] == '\0') {
927                                             // wglMakeCurrent
928                                             retrace_wglMakeCurrent(call);
929                                             return;
930                                         }
931                                         break;
932                                     }
933                                     break;
934                                 }
935                                 break;
936                             }
937                             break;
938                         }
939                         break;
940                     }
941                     break;
942                 case 'Q':
943                     if (name[4] == 'u' && name[5] == 'e' && name[6] == 'r' && name[7] == 'y' && name[8] == 'P' && name[9] == 'b' && name[10] == 'u' && name[11] == 'f' && name[12] == 'f' && name[13] == 'e' && name[14] == 'r' && name[15] == 'A' && name[16] == 'R' && name[17] == 'B' && name[18] == '\0') {
944                         // wglQueryPbufferARB
945                         retrace_wglQueryPbufferARB(call);
946                         return;
947                     }
948                     break;
949                 case 'R':
950                     switch (name[4]) {
951                     case 'e':
952                         switch (name[5]) {
953                         case 'a':
954                             if (name[6] == 'l' && name[7] == 'i' && name[8] == 'z' && name[9] == 'e' && name[10] == 'L' && name[11] == 'a' && name[12] == 'y' && name[13] == 'e' && name[14] == 'r' && name[15] == 'P' && name[16] == 'a' && name[17] == 'l' && name[18] == 'e' && name[19] == 't' && name[20] == 't' && name[21] == 'e' && name[22] == '\0') {
955                                 // wglRealizeLayerPalette
956                                 retrace_wglRealizeLayerPalette(call);
957                                 return;
958                             }
959                             break;
960                         case 'l':
961                             switch (name[6]) {
962                             case 'e':
963                                 switch (name[7]) {
964                                 case 'a':
965                                     switch (name[8]) {
966                                     case 's':
967                                         switch (name[9]) {
968                                         case 'e':
969                                             switch (name[10]) {
970                                             case 'P':
971                                                 if (name[11] == 'b' && name[12] == 'u' && name[13] == 'f' && name[14] == 'f' && name[15] == 'e' && name[16] == 'r' && name[17] == 'D' && name[18] == 'C' && name[19] == 'A' && name[20] == 'R' && name[21] == 'B' && name[22] == '\0') {
972                                                     // wglReleasePbufferDCARB
973                                                     retrace_wglReleasePbufferDCARB(call);
974                                                     return;
975                                                 }
976                                                 break;
977                                             case 'T':
978                                                 if (name[11] == 'e' && name[12] == 'x' && name[13] == 'I' && name[14] == 'm' && name[15] == 'a' && name[16] == 'g' && name[17] == 'e' && name[18] == 'A' && name[19] == 'R' && name[20] == 'B' && name[21] == '\0') {
979                                                     // wglReleaseTexImageARB
980                                                     retrace_wglReleaseTexImageARB(call);
981                                                     return;
982                                                 }
983                                                 break;
984                                             }
985                                             break;
986                                         }
987                                         break;
988                                     }
989                                     break;
990                                 }
991                                 break;
992                             }
993                             break;
994                         case 's':
995                             if (name[6] == 't' && name[7] == 'o' && name[8] == 'r' && name[9] == 'e' && name[10] == 'B' && name[11] == 'u' && name[12] == 'f' && name[13] == 'f' && name[14] == 'e' && name[15] == 'r' && name[16] == 'R' && name[17] == 'e' && name[18] == 'g' && name[19] == 'i' && name[20] == 'o' && name[21] == 'n' && name[22] == 'A' && name[23] == 'R' && name[24] == 'B' && name[25] == '\0') {
996                                 // wglRestoreBufferRegionARB
997                                 retrace_wglRestoreBufferRegionARB(call);
998                                 return;
999                             }
1000                             break;
1001                         }
1002                         break;
1003                     }
1004                     break;
1005                 case 'S':
1006                     switch (name[4]) {
1007                     case 'a':
1008                         if (name[5] == 'v' && name[6] == 'e' && name[7] == 'B' && name[8] == 'u' && name[9] == 'f' && name[10] == 'f' && name[11] == 'e' && name[12] == 'r' && name[13] == 'R' && name[14] == 'e' && name[15] == 'g' && name[16] == 'i' && name[17] == 'o' && name[18] == 'n' && name[19] == 'A' && name[20] == 'R' && name[21] == 'B' && name[22] == '\0') {
1009                             // wglSaveBufferRegionARB
1010                             retrace_wglSaveBufferRegionARB(call);
1011                             return;
1012                         }
1013                         break;
1014                     case 'e':
1015                         switch (name[5]) {
1016                         case 't':
1017                             switch (name[6]) {
1018                             case 'L':
1019                                 if (name[7] == 'a' && name[8] == 'y' && name[9] == 'e' && name[10] == 'r' && name[11] == 'P' && name[12] == 'a' && name[13] == 'l' && name[14] == 'e' && name[15] == 't' && name[16] == 't' && name[17] == 'e' && name[18] == 'E' && name[19] == 'n' && name[20] == 't' && name[21] == 'r' && name[22] == 'i' && name[23] == 'e' && name[24] == 's' && name[25] == '\0') {
1020                                     // wglSetLayerPaletteEntries
1021                                     retrace_wglSetLayerPaletteEntries(call);
1022                                     return;
1023                                 }
1024                                 break;
1025                             case 'P':
1026                                 switch (name[7]) {
1027                                 case 'b':
1028                                     if (name[8] == 'u' && name[9] == 'f' && name[10] == 'f' && name[11] == 'e' && name[12] == 'r' && name[13] == 'A' && name[14] == 't' && name[15] == 't' && name[16] == 'r' && name[17] == 'i' && name[18] == 'b' && name[19] == 'A' && name[20] == 'R' && name[21] == 'B' && name[22] == '\0') {
1029                                         // wglSetPbufferAttribARB
1030                                         retrace_wglSetPbufferAttribARB(call);
1031                                         return;
1032                                     }
1033                                     break;
1034                                 case 'i':
1035                                     if (name[8] == 'x' && name[9] == 'e' && name[10] == 'l' && name[11] == 'F' && name[12] == 'o' && name[13] == 'r' && name[14] == 'm' && name[15] == 'a' && name[16] == 't' && name[17] == '\0') {
1036                                         // wglSetPixelFormat
1037                                         retrace_wglSetPixelFormat(call);
1038                                         return;
1039                                     }
1040                                     break;
1041                                 }
1042                                 break;
1043                             }
1044                             break;
1045                         }
1046                         break;
1047                     case 'h':
1048                         if (name[5] == 'a' && name[6] == 'r' && name[7] == 'e' && name[8] == 'L' && name[9] == 'i' && name[10] == 's' && name[11] == 't' && name[12] == 's' && name[13] == '\0') {
1049                             // wglShareLists
1050                             retrace_wglShareLists(call);
1051                             return;
1052                         }
1053                         break;
1054                     case 'w':
1055                         switch (name[5]) {
1056                         case 'a':
1057                             switch (name[6]) {
1058                             case 'p':
1059                                 switch (name[7]) {
1060                                 case 'B':
1061                                     if (name[8] == 'u' && name[9] == 'f' && name[10] == 'f' && name[11] == 'e' && name[12] == 'r' && name[13] == 's' && name[14] == '\0') {
1062                                         // wglSwapBuffers
1063                                         retrace_wglSwapBuffers(call);
1064                                         return;
1065                                     }
1066                                     break;
1067                                 case 'I':
1068                                     if (name[8] == 'n' && name[9] == 't' && name[10] == 'e' && name[11] == 'r' && name[12] == 'v' && name[13] == 'a' && name[14] == 'l' && name[15] == 'E' && name[16] == 'X' && name[17] == 'T' && name[18] == '\0') {
1069                                         // wglSwapIntervalEXT
1070                                         retrace_wglSwapIntervalEXT(call);
1071                                         return;
1072                                     }
1073                                     break;
1074                                 case 'L':
1075                                     if (name[8] == 'a' && name[9] == 'y' && name[10] == 'e' && name[11] == 'r' && name[12] == 'B' && name[13] == 'u' && name[14] == 'f' && name[15] == 'f' && name[16] == 'e' && name[17] == 'r' && name[18] == 's' && name[19] == '\0') {
1076                                         // wglSwapLayerBuffers
1077                                         retrace_wglSwapLayerBuffers(call);
1078                                         return;
1079                                     }
1080                                     break;
1081                                 case 'M':
1082                                     if (name[8] == 'u' && name[9] == 'l' && name[10] == 't' && name[11] == 'i' && name[12] == 'p' && name[13] == 'l' && name[14] == 'e' && name[15] == 'B' && name[16] == 'u' && name[17] == 'f' && name[18] == 'f' && name[19] == 'e' && name[20] == 'r' && name[21] == 's' && name[22] == '\0') {
1083                                         // wglSwapMultipleBuffers
1084                                         retrace_wglSwapMultipleBuffers(call);
1085                                         return;
1086                                     }
1087                                     break;
1088                                 }
1089                                 break;
1090                             }
1091                             break;
1092                         }
1093                         break;
1094                     }
1095                     break;
1096                 case 'U':
1097                     switch (name[4]) {
1098                     case 's':
1099                         switch (name[5]) {
1100                         case 'e':
1101                             switch (name[6]) {
1102                             case 'F':
1103                                 switch (name[7]) {
1104                                 case 'o':
1105                                     switch (name[8]) {
1106                                     case 'n':
1107                                         switch (name[9]) {
1108                                         case 't':
1109                                             switch (name[10]) {
1110                                             case 'B':
1111                                                 switch (name[11]) {
1112                                                 case 'i':
1113                                                     switch (name[12]) {
1114                                                     case 't':
1115                                                         switch (name[13]) {
1116                                                         case 'm':
1117                                                             switch (name[14]) {
1118                                                             case 'a':
1119                                                                 switch (name[15]) {
1120                                                                 case 'p':
1121                                                                     switch (name[16]) {
1122                                                                     case 's':
1123                                                                         switch (name[17]) {
1124                                                                         case 'A':
1125                                                                             if (name[18] == '\0') {
1126                                                                                 // wglUseFontBitmapsA
1127                                                                                 retrace_wglUseFontBitmapsA(call);
1128                                                                                 return;
1129                                                                             }
1130                                                                             break;
1131                                                                         case 'W':
1132                                                                             if (name[18] == '\0') {
1133                                                                                 // wglUseFontBitmapsW
1134                                                                                 retrace_wglUseFontBitmapsW(call);
1135                                                                                 return;
1136                                                                             }
1137                                                                             break;
1138                                                                         }
1139                                                                         break;
1140                                                                     }
1141                                                                     break;
1142                                                                 }
1143                                                                 break;
1144                                                             }
1145                                                             break;
1146                                                         }
1147                                                         break;
1148                                                     }
1149                                                     break;
1150                                                 }
1151                                                 break;
1152                                             case 'O':
1153                                                 switch (name[11]) {
1154                                                 case 'u':
1155                                                     switch (name[12]) {
1156                                                     case 't':
1157                                                         switch (name[13]) {
1158                                                         case 'l':
1159                                                             switch (name[14]) {
1160                                                             case 'i':
1161                                                                 switch (name[15]) {
1162                                                                 case 'n':
1163                                                                     switch (name[16]) {
1164                                                                     case 'e':
1165                                                                         switch (name[17]) {
1166                                                                         case 's':
1167                                                                             switch (name[18]) {
1168                                                                             case 'A':
1169                                                                                 if (name[19] == '\0') {
1170                                                                                     // wglUseFontOutlinesA
1171                                                                                     retrace_wglUseFontOutlinesA(call);
1172                                                                                     return;
1173                                                                                 }
1174                                                                                 break;
1175                                                                             case 'W':
1176                                                                                 if (name[19] == '\0') {
1177                                                                                     // wglUseFontOutlinesW
1178                                                                                     retrace_wglUseFontOutlinesW(call);
1179                                                                                     return;
1180                                                                                 }
1181                                                                                 break;
1182                                                                             }
1183                                                                             break;
1184                                                                         }
1185                                                                         break;
1186                                                                     }
1187                                                                     break;
1188                                                                 }
1189                                                                 break;
1190                                                             }
1191                                                             break;
1192                                                         }
1193                                                         break;
1194                                                     }
1195                                                     break;
1196                                                 }
1197                                                 break;
1198                                             }
1199                                             break;
1200                                         }
1201                                         break;
1202                                     }
1203                                     break;
1204                                 }
1205                                 break;
1206                             }
1207                             break;
1208                         }
1209                         break;
1210                     }
1211                     break;
1212                 }
1213                 break;
1214             }
1215             break;
1216         }
1217         break;
1218     }
1219     retrace::retrace_unknown(call);
1220 }
1221