/[gzz]/gzz/gfx/libglwrapper/wrapper.pl
ViewVC logotype

Diff of /gzz/gfx/libglwrapper/wrapper.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by mudyc, Mon Sep 30 06:38:39 2002 UTC revision 1.4 by mudyc, Thu Oct 10 13:45:09 2002 UTC
# Line 11  my @GL_1_1_funcs = (); Line 11  my @GL_1_1_funcs = ();
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//;
# Line 199  GLint GL_kludge_error_GLint(const char * Line 248  GLint GL_kludge_error_GLint(const char *
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 ) {
# Line 236  GLint GL_kludge_error_GLint(const char * Line 284  GLint GL_kludge_error_GLint(const char *
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    

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26