mirror of
https://github.com/nigels-com/glew.git
synced 2024-11-28 08:41:55 +00:00
EGL refinements and fixes
This commit is contained in:
parent
d49c323cba
commit
db99bbcee3
@ -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" >> $@
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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 */
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
}
|
||||
|
||||
#elif !defined(GLEW_OSMESA) /* _UNIX */
|
||||
#elif !defined(GLEW_EGL) && !defined(GLEW_OSMESA) /* _UNIX */
|
||||
|
||||
static void glxewInfo ()
|
||||
{
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user