|
kusano |
7d535a |
#!/usr/bin/perl
|
|
kusano |
7d535a |
##
|
|
kusano |
7d535a |
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org=""></mmagallo[]debian>
|
|
kusano |
7d535a |
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee="" org=""></milan>
|
|
kusano |
7d535a |
##
|
|
kusano |
7d535a |
## This program is distributed under the terms and conditions of the GNU
|
|
kusano |
7d535a |
## General Public License Version 2 as published by the Free Software
|
|
kusano |
7d535a |
## Foundation or, at your option, any later version.
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
use strict;
|
|
kusano |
7d535a |
use warnings;
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
do 'bin/make.pl';
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
#---------------------------------------------------------------------------------------
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
# function pointer definition
|
|
kusano |
7d535a |
sub make_init_call($%)
|
|
kusano |
7d535a |
{
|
|
kusano |
7d535a |
my $name = prefixname($_[0]);
|
|
kusano |
7d535a |
return " r = r || (" . $_[0] . " = (PFN" . (uc $_[0]) . "PROC)glewGetProcAddress(\"" . $name . "\")) == NULL;";
|
|
kusano |
7d535a |
}
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
#---------------------------------------------------------------------------------------
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
my @extlist = ();
|
|
kusano |
7d535a |
my %extensions = ();
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
if (@ARGV)
|
|
kusano |
7d535a |
{
|
|
kusano |
7d535a |
@extlist = @ARGV;
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
foreach my $ext (sort @extlist)
|
|
kusano |
7d535a |
{
|
|
kusano |
7d535a |
my ($extname, $exturl, $extstring, $types, $tokens, $functions, $exacts) = parse_ext($ext);
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
my $extvar = $extname;
|
|
kusano |
7d535a |
$extvar =~ s/GL(X*)_/GL$1EW_/;
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
my $extpre = $extname;
|
|
kusano |
7d535a |
$extpre =~ s/^(W?)GL(X?).*$/\l$1gl\l$2ew/;
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
#my $pextvar = prefix_varname($extvar);
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
print "#ifdef $extname\n";
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
if (length($extstring))
|
|
kusano |
7d535a |
{
|
|
kusano |
7d535a |
print " CONST_CAST(" . $extvar . ") = _glewSearchExtension(\"$extstring\", extStart, extEnd);\n";
|
|
kusano |
7d535a |
}
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
if (keys %$functions)
|
|
kusano |
7d535a |
{
|
|
kusano |
7d535a |
if ($extname =~ /WGL_.*/)
|
|
kusano |
7d535a |
{
|
|
kusano |
7d535a |
print " if (glewExperimental || " . $extvar . "|| crippled) CONST_CAST(" . $extvar . ")= !_glewInit_$extname(GLEW_CONTEXT_ARG_VAR_INIT);\n";
|
|
kusano |
7d535a |
}
|
|
kusano |
7d535a |
else
|
|
kusano |
7d535a |
{
|
|
kusano |
7d535a |
print " if (glewExperimental || " . $extvar . ") CONST_CAST(" . $extvar . ") = !_glewInit_$extname(GLEW_CONTEXT_ARG_VAR_INIT);\n";
|
|
kusano |
7d535a |
}
|
|
kusano |
7d535a |
}
|
|
kusano |
7d535a |
print "#endif /* $extname */\n";
|
|
kusano |
7d535a |
}
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
}
|