4 /* Auto-generated file... Do not edit ! */
9 #include \"opengl_ext.h\"
14 # First, create a hash-table with all function defined in opengl32.spec
17 open(SPEC
, "dlls/opengl32/opengl32.spec") || die "Could not open spec file";
19 if (($_ =~ /@/) && ($_ !~ /wgl/)) {
20 ($name) = ($_ =~ /stdcall (\w*)\(/);
21 $opengl_std{$name} = 1;
27 # Now, the functions from the include file
30 open(INC
, "/home/ulmer/OpenGL/glext_proto.h") || die "Could not open GL/glext.h";
31 while ($line = <INC
>) {
32 if ($line =~ /extern.*APIENTRY/) {
33 # Start of a function declaration
34 ($ret, $name, $args) = ($line =~ /extern (\w*) APIENTRY *(\w*) *\((.*)\)/);
36 # Now, remove all function already defined in opengl32.spec
37 if ($opengl_std{$name}) {
38 # Do nothing as we already have these functions
40 # Now, get the typedef name (the line after)
41 ($typedef_name) = (<INC
> =~ /\(APIENTRY *\* *(\w*) *\)/);
43 # After that, parse the arguments
44 @args = split /,/, $args;
49 $opengl_ext{$name} = [ $ret, $typedef_name, $args_ref ];
56 # After that, generate the file itself....
58 print "/* These will be filled during a wglGetProcAddress call */\n";
60 foreach $name (sort keys(%opengl_ext)) {
61 $ref = $opengl_ext{$name};
65 print "$$ref[0] (*func_$name)(";
71 print ") = (void *) 0xdeadbeef;\n";
76 print "/* The function prototypes */\n";
77 foreach $name (sort keys(%opengl_ext)) {
78 $ref = $opengl_ext{$name};
81 print "$$ref[0] WINAPI wine_$name(";
93 print "/* The table giving the correspondance between names and functions */\n";
94 print "int extension_registry_size = $num;\n";
95 print "OpenGL_extension extension_registry[] = {\n";
96 foreach $name (sort keys(%opengl_ext)) {
98 print " { \"$name\", (void *) wine_$name, (void **) (&func_$name) }";
107 print "/* Now, the function declarations */\n";
108 foreach $name (sort keys(%opengl_ext)) {
109 $ref = $opengl_ext{$name};
111 print "$$ref[0] WINAPI wine_$name(";
113 $farg = shift @
$arg_ref;
115 if ($farg !~ /void/) {
118 foreach (@
$arg_ref) {
119 print ", $_ arg_$num";
124 if ($$ref[0] !~ /void/) {
125 print " $$ref[0] ret;\n"
127 print " ENTER_GL();\n";
129 if ($$ref[0] !~ /void/) {
135 for ($i = 1; $i < $num; $i++) {
140 print " LEAVE_GL();\n";
141 if ($$ref[0] !~ /void/) {
142 print " return ret;\n"