EGL refinements and fixes

This commit is contained in:
Nigel Stewart 2016-01-23 21:32:55 +10:00
parent 20908a2182
commit 84b733d9bb
7 changed files with 37 additions and 18 deletions

View File

@ -280,6 +280,8 @@ $(S.DEST)/glewinfo.c: $(EXT)/.dummy
$(BIN)/make_info.pl $(GL_CORE_SPEC) >> $@
$(BIN)/make_info.pl $(GL_EXT_SPEC) >> $@
echo -e "#if defined(GLEW_EGL)\n" >> $@
$(BIN)/make_info.pl $(EGL_CORE_SPEC) >> $@
$(BIN)/make_info.pl $(EGL_EXT_SPEC) >> $@
echo -e "#elif _WIN32\n" >> $@
$(BIN)/make_info.pl $(WGL_EXT_SPEC) >> $@
echo -e "#else /* _UNIX */\n" >> $@

View File

@ -24,11 +24,11 @@ if (@ARGV)
{
my ($extname, $exturl, $extstring, $reuse, $types, $tokens, $functions, $exacts) = parse_ext($ext);
my $exttype = $extname;
$exttype =~ s/(W*?)GL(X*?)_(.*?_)(.*)/$3/;
$exttype =~ s/(W?E?)GL(X?)_(.*?_)(.*)/$3/;
my $extrem = $extname;
$extrem =~ s/(W*?)GL(X*?)_(.*?_)(.*)/$4/;
$extrem =~ s/(W?E?)GL(X?)_(.*?_)(.*)/$4/;
my $extvar = $extname;
$extvar =~ s/(W*)GL(X*)_/$1GL$2EW_/;
$extvar =~ s/(W?E?)GL(X?)_/$1GL$2EW_/;
if(!($exttype =~ $curexttype))
{
if(length($curexttype) > 0)

View File

@ -66,6 +66,8 @@ typedef khronos_utime_nanoseconds_t EGLuint64NV;
struct EGLClientPixmapHI;
#define EGL_DEFAULT_DISPLAY ((EGLNativeDisplayType)0)
EGLAPI __eglMustCastToProperFunctionPointerType EGLAPIENTRY eglGetProcAddress (const char *procname);
#ifdef __cplusplus

View File

@ -5,27 +5,42 @@ GLboolean eglewGetExtension (const char* name)
const GLubyte* start;
const GLubyte* end;
/* TODO */
/* return _glewSearchExtension(name, start, end); */
return GL_FALSE;
start = (const GLubyte*) eglQueryString(eglGetDisplay(EGL_DEFAULT_DISPLAY), EGL_EXTENSIONS);
if (0 == start) return GL_FALSE;
end = start + _glewStrLen(start);
return _glewSearchExtension(name, start, end);
}
GLenum eglewInit ()
{
int major, minor;
GLuint dot;
GLint major, minor;
const GLubyte* version;
const GLubyte* extStart;
const GLubyte* extEnd;
/* initialize flags */
EGLEW_VERSION_1_0 = GL_TRUE;
EGLEW_VERSION_1_1 = GL_TRUE;
EGLEW_VERSION_1_2 = GL_TRUE;
EGLEW_VERSION_1_3 = GL_TRUE;
EGLEW_VERSION_1_4 = GL_TRUE;
EGLEW_VERSION_1_5 = GL_TRUE;
/* query EGK version */
major = 0;
minor = 0;
version = (const GLubyte*) eglQueryString(eglGetDisplay(EGL_DEFAULT_DISPLAY), EGL_VERSION);
dot = _glewStrCLen(version, '.');
if (dot != 0)
{
major = version[dot-1]-'0';
minor = version[dot+1]-'0';
}
/* query EGL version */
EGLEW_VERSION_1_5 = ( major > 1 ) || ( major == 1 && minor >= 5 ) ? GL_TRUE : GL_FALSE;
EGLEW_VERSION_1_4 = EGLEW_VERSION_1_5 == GL_TRUE || ( major == 1 && minor >= 4 ) ? GL_TRUE : GL_FALSE;
EGLEW_VERSION_1_3 = EGLEW_VERSION_1_4 == GL_TRUE || ( major == 1 && minor >= 3 ) ? GL_TRUE : GL_FALSE;
EGLEW_VERSION_1_2 = EGLEW_VERSION_1_3 == GL_TRUE || ( major == 1 && minor >= 2 ) ? GL_TRUE : GL_FALSE;
EGLEW_VERSION_1_1 = EGLEW_VERSION_1_2 == GL_TRUE || ( major == 1 && minor >= 1 ) ? GL_TRUE : GL_FALSE;
EGLEW_VERSION_1_0 = EGLEW_VERSION_1_1 == GL_TRUE || ( major == 1 && minor >= 0 ) ? GL_TRUE : GL_FALSE;
/* query EGL extension string */
extStart = (const GLubyte*) eglQueryString(eglGetDisplay(EGL_DEFAULT_DISPLAY), EGL_EXTENSIONS);
if (extStart == 0)
extStart = (const GLubyte *)"";
extEnd = extStart + _glewStrLen(extStart);
/* initialize extensions */

View File

@ -4,7 +4,7 @@
return ret;
}
#elif !defined(GLEW_OSMESA) && !defined(__ANDROID__) && !defined(__native_client__) && !defined(__HAIKU__) && !defined(__APPLE__) || defined(GLEW_APPLE_GLX)
#elif !defined(GLEW_OSMESA) && !defined(GLEW_EGL) && !defined(__ANDROID__) && !defined(__native_client__) && !defined(__HAIKU__) && !defined(__APPLE__) || defined(GLEW_APPLE_GLX)
GLboolean glxewIsSupported (const char* name)
{

View File

@ -1,6 +1,6 @@
}
#elif !defined(GLEW_OSMESA) /* _UNIX */
#elif !defined(GLEW_EGL) && !defined(GLEW_OSMESA) /* _UNIX */
static void glxewInfo ()
{

View File

@ -3,7 +3,7 @@
#include <string.h>
#include <GL/glew.h>
#if defined(GLEW_EGL)
#include <EGL/egl.h>
#include <GL/eglew.h>
#elif defined(GLEW_OSMESA)
#define GLAPI extern
#include <GL/osmesa.h>