mirror of
https://github.com/Perlmint/glew-cmake.git
synced 2024-11-11 09:33:49 +00:00
Revert "Use git instead of clone to download OpenGL registry."
This reverts commit 974679c6d8
.
This commit is contained in:
parent
e0242aa735
commit
b56f8e70e8
@ -197,9 +197,8 @@ $(S.DEST)/glew.c: $(EXT)/.dummy
|
||||
$(BIN)/make_init.pl GL $(GL_CORE_SPEC) >> $@
|
||||
$(BIN)/make_init.pl GL $(GL_EXT_SPEC) >> $@
|
||||
cat $(SRC)/glew_init_gl.c >> $@
|
||||
$(BIN)/make_list_gl.pl $(GL_CORE_SPEC) | grep -v '\"GL_VERSION' >> $@
|
||||
cat $(SRC)/glew_init_gl_2.c >> $@
|
||||
$(BIN)/make_list_gl.pl $(GL_EXT_SPEC) >> $@
|
||||
$(BIN)/make_list.pl $(GL_CORE_SPEC) | grep -v '\"GL_VERSION' >> $@
|
||||
$(BIN)/make_list.pl $(GL_EXT_SPEC) >> $@
|
||||
echo -e "\n return GLEW_OK;\n}\n" >> $@
|
||||
echo -e "\n#if defined(_WIN32)" >> $@
|
||||
echo -e "\n#if !defined(GLEW_MX)" >> $@
|
||||
@ -275,7 +274,6 @@ $(S.DEST)/glew_init.c: $(EXT)/.dummy
|
||||
$(BIN)/make_init.pl GL $(GL_EXT_SPEC) >> $@
|
||||
cat $(SRC)/glew_init_gl.c >> $@
|
||||
$(BIN)/make_list.pl $(GL_CORE_SPEC) | grep -v '\"GL_VERSION' >> $@
|
||||
cat $(SRC)/glew_init_gl_2.c >> $@
|
||||
$(BIN)/make_list.pl $(GL_EXT_SPEC) >> $@
|
||||
echo -e "\n return GLEW_OK;\n}\n\n#if defined(_WIN32)\n" >> $@;
|
||||
$(BIN)/make_init.pl WGL $(WGL_EXT_SPEC) >> $@
|
||||
|
@ -1,66 +0,0 @@
|
||||
#!/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';
|
||||
|
||||
#---------------------------------------------------------------------------------------
|
||||
|
||||
# function pointer definition
|
||||
sub make_init_call($%)
|
||||
{
|
||||
my $name = prefixname($_[0]);
|
||||
return " r = r || (" . $_[0] . " = (PFN" . (uc $_[0]) . "PROC)glewGetProcAddress(\"" . $name . "\")) == NULL;";
|
||||
}
|
||||
|
||||
#---------------------------------------------------------------------------------------
|
||||
|
||||
my @extlist = ();
|
||||
my %extensions = ();
|
||||
|
||||
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_/;
|
||||
|
||||
my $extpre = $extname;
|
||||
$extpre =~ s/^(W?)GL(X?).*$/\l$1gl\l$2ew/;
|
||||
|
||||
#my $pextvar = prefix_varname($extvar);
|
||||
|
||||
print "#ifdef $extname\n";
|
||||
|
||||
if (length($extstring))
|
||||
{
|
||||
print " CONST_CAST(" . $extvar . ") = _glewSearchExtensionArray(\"$extstring\", extArrayStart, extArrayEnd);\n";
|
||||
}
|
||||
|
||||
if (keys %$functions)
|
||||
{
|
||||
if ($extname =~ /WGL_.*/)
|
||||
{
|
||||
print " if (glewExperimental || " . $extvar . "|| crippled) CONST_CAST(" . $extvar . ")= !_glewInit_$extname(GLEW_CONTEXT_ARG_VAR_INIT);\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
print " if (glewExperimental || " . $extvar . ") CONST_CAST(" . $extvar . ") = !_glewInit_$extname(GLEW_CONTEXT_ARG_VAR_INIT);\n";
|
||||
}
|
||||
}
|
||||
print "#endif /* $extname */\n";
|
||||
}
|
||||
|
||||
}
|
33
auto/bin/update_registry.sh
Executable file
33
auto/bin/update_registry.sh
Executable file
@ -0,0 +1,33 @@
|
||||
#!/bin/sh
|
||||
##
|
||||
## 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.
|
||||
|
||||
set -e
|
||||
|
||||
if [ ! -d $1 ] ; then
|
||||
mkdir -p $1
|
||||
fi
|
||||
cd $1
|
||||
|
||||
# wget used to return 0 (success), but more recent versions
|
||||
# don't so we don't want to bail out in failure mode
|
||||
# eventhough everything is fine.
|
||||
|
||||
set +e
|
||||
|
||||
wget \
|
||||
--mirror \
|
||||
--no-parent \
|
||||
--no-host-directories \
|
||||
--cut-dirs=2 \
|
||||
--accept=txt,html \
|
||||
$2
|
||||
|
||||
echo 'wget exit code: ' $?
|
||||
|
||||
exit 0
|
@ -247,18 +247,3 @@ static GLboolean _glewSearchExtension (const char* name, const GLubyte *start, c
|
||||
}
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
static GLboolean _glewSearchExtensionArray (const char* name, const GLubyte** start, const GLubyte** end)
|
||||
{
|
||||
const GLubyte** p;
|
||||
GLuint len = _glewStrLen((const GLubyte*)name);
|
||||
p = start;
|
||||
while (p < end)
|
||||
{
|
||||
GLuint n = _glewStrCLen(*p, ' ');
|
||||
if (len == n && _glewStrSame((const GLubyte*)name, *p, n)) return GL_TRUE;
|
||||
p += 1;
|
||||
}
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
|
@ -1,38 +1,14 @@
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
GLboolean GLEWAPIENTRY glewGetExtension (const char* name)
|
||||
{
|
||||
{
|
||||
const GLubyte* start;
|
||||
const GLubyte* end;
|
||||
GLuint dot;
|
||||
GLint numExt, i, major;
|
||||
/* query opengl version to decide how to enumerate extensions */
|
||||
start = glGetString(GL_VERSION);
|
||||
dot = _glewStrCLen(start, '.');
|
||||
if (dot == 0)
|
||||
return GL_FALSE;
|
||||
major = start[dot-1]-'0';
|
||||
|
||||
if (major >= 3)
|
||||
{
|
||||
glGetIntegerv(GL_NUM_EXTENSIONS, &numExt);
|
||||
for(i = 0; i < numExt; ++i)
|
||||
{
|
||||
start = glGetStringi(GL_EXTENSIONS, i);
|
||||
end = start + _glewStrLen(start);
|
||||
if(_glewSearchExtension(name, start, end) == GL_TRUE)
|
||||
return GL_TRUE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
start = (const GLubyte*)glGetString(GL_EXTENSIONS);
|
||||
if (start == 0)
|
||||
return GL_FALSE;
|
||||
end = start + _glewStrLen(start);
|
||||
return _glewSearchExtension(name, start, end);
|
||||
}
|
||||
return GL_FALSE;
|
||||
start = (const GLubyte*)glGetString(GL_EXTENSIONS);
|
||||
if (start == 0)
|
||||
return GL_FALSE;
|
||||
end = start + _glewStrLen(start);
|
||||
return _glewSearchExtension(name, start, end);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
@ -45,9 +21,6 @@ GLenum GLEWAPIENTRY glewContextInit (GLEW_CONTEXT_ARG_DEF_LIST)
|
||||
const GLubyte* s;
|
||||
GLuint dot;
|
||||
GLint major, minor;
|
||||
const GLubyte* extArray[1000];
|
||||
const GLubyte** extArrayStart;
|
||||
const GLubyte** extArrayEnd;
|
||||
const GLubyte* extStart;
|
||||
const GLubyte* extEnd;
|
||||
/* query opengl version */
|
||||
@ -89,4 +62,10 @@ GLenum GLEWAPIENTRY glewContextInit (GLEW_CONTEXT_ARG_DEF_LIST)
|
||||
CONST_CAST(GLEW_VERSION_1_1) = GLEW_VERSION_1_2 == GL_TRUE || ( major == 1 && minor >= 1 ) ? GL_TRUE : GL_FALSE;
|
||||
}
|
||||
|
||||
/* initialize core */
|
||||
/* query opengl extensions string */
|
||||
extStart = glGetString(GL_EXTENSIONS);
|
||||
if (extStart == 0)
|
||||
extStart = (const GLubyte*)"";
|
||||
extEnd = extStart + _glewStrLen(extStart);
|
||||
|
||||
/* initialize extensions */
|
||||
|
@ -1,44 +0,0 @@
|
||||
|
||||
/* get extensions */
|
||||
if (GLEW_VERSION_3_0 == GL_TRUE)
|
||||
{
|
||||
GLint numExt;
|
||||
GLint i;
|
||||
glGetIntegerv(GL_NUM_EXTENSIONS, &numExt);
|
||||
|
||||
for(i = 0; i < numExt; ++i)
|
||||
{
|
||||
extArray[i] = glGetStringi(GL_EXTENSIONS, i);
|
||||
}
|
||||
|
||||
extArrayStart = &extArray[0];
|
||||
extArrayEnd = &extArray[i];
|
||||
}
|
||||
else
|
||||
{
|
||||
int i;
|
||||
|
||||
extStart = glGetString(GL_EXTENSIONS);
|
||||
if (extStart == 0)
|
||||
extStart = (const GLubyte*)"";
|
||||
extEnd = extStart + _glewStrLen(extStart);
|
||||
i = 0;
|
||||
|
||||
while (extStart < extEnd)
|
||||
{
|
||||
int len = _glewStrCLen(extStart, ' ');
|
||||
|
||||
if (len > 0)
|
||||
{
|
||||
extArray[i] = extStart;
|
||||
i += 1;
|
||||
}
|
||||
|
||||
extStart += len + 1;
|
||||
}
|
||||
|
||||
extArrayStart = &extArray[0];
|
||||
extArrayEnd = &extArray[i];
|
||||
}
|
||||
|
||||
/* initialize extensions */
|
Loading…
Reference in New Issue
Block a user