11 |
my @GL_1_1_funcs_checked = (); |
my @GL_1_1_funcs_checked = (); |
12 |
|
|
13 |
|
|
14 |
|
sub check_if_ARB_exist { |
15 |
|
my ($ptr, $check_func) = @_; |
16 |
|
|
17 |
|
$check_func =~ s/ //g; |
18 |
|
|
19 |
|
# print " \'$check_func\'\n"; |
20 |
|
|
21 |
|
$check_func = "${check_func}ARB"; |
22 |
|
|
23 |
|
my @file = @{$ptr}; |
24 |
|
|
25 |
|
foreach(@file) { |
26 |
|
my ($return_type, $rest) = split / /, $_, 2; |
27 |
|
my ($func, $args) = split /\(/, $rest, 2; |
28 |
|
chop $func; |
29 |
|
|
30 |
|
if ($func eq $check_func) { |
31 |
|
# print "find: \'$func\'\n"; |
32 |
|
return "true"; |
33 |
|
} |
34 |
|
} |
35 |
|
return "false"; |
36 |
|
} |
37 |
|
|
38 |
|
sub remove { |
39 |
|
my ($ptr, $func_to_remove) = @_; |
40 |
|
$func_to_remove =~ s/ //g; |
41 |
|
|
42 |
|
# print " removed unARB: \'$func_to_remove\'\n"; |
43 |
|
|
44 |
|
my @file = @{$ptr}; |
45 |
|
|
46 |
|
for(my $i=0; $i<@file; $i++) { |
47 |
|
my ($return_type, $rest) = split / /, $file[$i], 2; |
48 |
|
my ($func, $args) = split /\(/, $rest, 2; |
49 |
|
chop $func; |
50 |
|
|
51 |
|
# print " \'$func\' - \'$func_to_remove\'\n"; |
52 |
|
|
53 |
|
if ($func eq $func_to_remove) { |
54 |
|
# print " found : $func\n"; |
55 |
|
splice (@file, $i, 1); |
56 |
|
$i--; |
57 |
|
} |
58 |
|
} |
59 |
|
return @file; |
60 |
|
} |
61 |
|
|
62 |
|
|
63 |
sub check_if_1_1_func_name { |
sub check_if_1_1_func_name { |
64 |
my $check_func = "@_"; |
my $check_func = "@_"; |
65 |
$check_func =~ s/^gl//; |
$check_func =~ s/^gl//; |
248 |
} |
} |
249 |
|
|
250 |
sort(@GL_1_1_funcs); |
sort(@GL_1_1_funcs); |
251 |
|
|
|
|
|
252 |
my @file = (); |
my @file = (); |
253 |
|
|
254 |
if ( -e $header_file ) { |
if ( -e $header_file ) { |
284 |
# =========== |
# =========== |
285 |
open(GL_HEADER, ">>$kludge_file_name.hxx") |
open(GL_HEADER, ">>$kludge_file_name.hxx") |
286 |
or die; |
or die; |
287 |
foreach(@file) { |
for(my $i=0; $i<@file; $i++ ) { |
288 |
my ($return_type, $rest) = split / /, $_, 2; |
my ($return_type, $rest) = split / /, $file[$i], 2; |
289 |
my ($func, $args) = split /\(/, $rest, 2; |
my ($func, $args) = split /\(/, $rest, 2; |
290 |
print GL_HEADER "extern $return_type (* _$func)($args\n"; |
$func =~ s/ //g; |
291 |
print GL_HEADER "\#define $func _$func\n"; |
|
292 |
|
if ( check_if_ARB_exist(\@file, $func) eq "true") { |
293 |
|
print GL_HEADER "\#define $func _${func}ARB\n"; |
294 |
|
|
295 |
|
# we don't need stub_function to it anymore so |
296 |
|
@file = remove(\@file, $func); |
297 |
|
$i--; |
298 |
|
} else { |
299 |
|
#print " \'$func\'\n"; |
300 |
|
print GL_HEADER "extern $return_type (* _$func)($args\n"; |
301 |
|
print GL_HEADER "\#define $func _$func\n"; |
302 |
|
} |
303 |
} |
} |
304 |
close GL_HEADER; |
close GL_HEADER; |
305 |
|
|