Commit 1da7dd6e authored by Nigel Stewart's avatar Nigel Stewart
Browse files

[CoreSupport] Add code generation for sorted array of extension strings, which...

[CoreSupport] Add code generation for sorted array of extension strings, which can index into array of pointers of extension enable flags.
parent ea763af9
......@@ -198,7 +198,14 @@ $(S.DEST)/glew.c: $(EXT)/.dummy
$(BIN)/make_def_var.pl GL $(GL_CORE_SPEC) >> $@
$(BIN)/make_def_var.pl GL $(GL_EXT_SPEC) >> $@
echo -e "\n#endif /* !GLEW_MX */\n" >> $@;
echo -e "" >> $@;
echo -e "\nstatic const char * _glewExtensionLookup[] = {" >> $@;
$(BIN)/make_index.pl $(GL_EXT_SPEC) >> $@
echo -e " NULL\n};\n" >> $@;
echo -e "\n#if !defined(GLEW_MX)" >> $@;
echo -e "\nstatic GLboolean* _glewEnabled[] = {" >> $@;
$(BIN)/make_enable_index.pl $(GL_CORE_SPEC) $(GL_EXT_SPEC) >> $@
echo -e " NULL\n};\n" >> $@;
echo -e "\n#endif /* !GLEW_MX */\n" >> $@;
$(BIN)/make_initd.pl GL $(GL_CORE_SPEC) >> $@
$(BIN)/make_initd.pl GL $(GL_EXT_SPEC) >> $@
echo -e "" >> $@;
......
#!/usr/bin/perl
##
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
##
## This program is distributed under the terms and conditions of the GNU
## General Public License Version 2 as published by the Free Software
## Foundation or, at your option, any later version.
use strict;
use warnings;
do 'bin/make.pl';
##
## Make Extension-enabled Index
##
my @extlist = ();
if (@ARGV)
{
@extlist = @ARGV;
foreach my $ext (sort @extlist)
{
my ($extname, $exturl, $extstring, $types, $tokens, $functions, $exacts) =
parse_ext($ext);
my $extvar = $extname;
$extvar =~ s/GL(X*)_/GL$1EW_/;
print "#ifdef $extname\n";
print " &__$extvar,\n";
print "#endif\n";
}
}
#!/usr/bin/perl
##
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
##
## This program is distributed under the terms and conditions of the GNU
## General Public License Version 2 as published by the Free Software
## Foundation or, at your option, any later version.
use strict;
use warnings;
do 'bin/make.pl';
##
## Make Index
##
## Output sorted array of extension strings for indexing into extension
## enable/disable flags. This provides a way to convert an extension string
## into an integer index.
##
my @extlist = ();
if (@ARGV)
{
@extlist = @ARGV;
foreach my $ext (sort @extlist)
{
my ($extname, $exturl, $extstring, $types, $tokens, $functions, $exacts) =
parse_ext($ext);
print "#ifdef $extname\n";
print " \"$extstring\",\n";
print "#endif\n";
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment