Ajout version Release/x64 avec les libraries x64 et tuning de la version Debug

This commit is contained in:
MarcEricMartel
2021-12-10 07:16:43 -05:00
parent 9b56a9b4a5
commit f4ec4816af
2745 changed files with 292873 additions and 8 deletions

View File

@@ -0,0 +1,88 @@
#ifndef __eglew_h__
#define __eglew_h__
#define __EGLEW_H__
#ifdef __eglext_h_
#error eglext.h included before eglew.h
#endif
#if defined(__egl_h_)
#error egl.h included before eglew.h
#endif
#define __eglext_h_
#define __egl_h_
#ifndef EGLAPIENTRY
#define EGLAPIENTRY
#endif
#ifndef EGLAPI
#define EGLAPI extern
#endif
/* EGL Types */
#include <sys/types.h>
#include <KHR/khrplatform.h>
#include <EGL/eglplatform.h>
#include <GL/glew.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef int32_t EGLint;
typedef unsigned int EGLBoolean;
typedef void *EGLDisplay;
typedef void *EGLConfig;
typedef void *EGLSurface;
typedef void *EGLContext;
typedef void (*__eglMustCastToProperFunctionPointerType)(void);
typedef unsigned int EGLenum;
typedef void *EGLClientBuffer;
typedef void *EGLSync;
typedef intptr_t EGLAttrib;
typedef khronos_utime_nanoseconds_t EGLTime;
typedef void *EGLImage;
typedef void *EGLSyncKHR;
typedef intptr_t EGLAttribKHR;
typedef void *EGLLabelKHR;
typedef void *EGLObjectKHR;
typedef void (EGLAPIENTRY *EGLDEBUGPROCKHR)(EGLenum error,const char *command,EGLint messageType,EGLLabelKHR threadLabel,EGLLabelKHR objectLabel,const char* message);
typedef khronos_utime_nanoseconds_t EGLTimeKHR;
typedef void *EGLImageKHR;
typedef void *EGLStreamKHR;
typedef khronos_uint64_t EGLuint64KHR;
typedef int EGLNativeFileDescriptorKHR;
typedef khronos_ssize_t EGLsizeiANDROID;
typedef void (*EGLSetBlobFuncANDROID) (const void *key, EGLsizeiANDROID keySize, const void *value, EGLsizeiANDROID valueSize);
typedef EGLsizeiANDROID (*EGLGetBlobFuncANDROID) (const void *key, EGLsizeiANDROID keySize, void *value, EGLsizeiANDROID valueSize);
typedef void *EGLDeviceEXT;
typedef void *EGLOutputLayerEXT;
typedef void *EGLOutputPortEXT;
typedef void *EGLSyncNV;
typedef khronos_utime_nanoseconds_t EGLTimeNV;
typedef khronos_utime_nanoseconds_t EGLuint64NV;
typedef khronos_stime_nanoseconds_t EGLnsecsANDROID;
struct EGLClientPixmapHI;
#define EGL_DONT_CARE ((EGLint)-1)
#define EGL_NO_CONTEXT ((EGLContext)0)
#define EGL_NO_DISPLAY ((EGLDisplay)0)
#define EGL_NO_IMAGE ((EGLImage)0)
#define EGL_NO_SURFACE ((EGLSurface)0)
#define EGL_NO_SYNC ((EGLSync)0)
#define EGL_UNKNOWN ((EGLint)-1)
#define EGL_DEFAULT_DISPLAY ((EGLNativeDisplayType)0)
EGLAPI __eglMustCastToProperFunctionPointerType EGLAPIENTRY eglGetProcAddress (const char *procname);

View File

@@ -0,0 +1,4 @@
/* ------------------------------------------------------------------------- */
#define EGLEW_FUN_EXPORT GLEW_FUN_EXPORT
#define EGLEW_VAR_EXPORT GLEW_VAR_EXPORT

View File

@@ -0,0 +1,15 @@
/* ------------------------------------------------------------------------ */
GLEWAPI GLenum GLEWAPIENTRY eglewInit (EGLDisplay display);
GLEWAPI GLboolean GLEWAPIENTRY eglewIsSupported (const char *name);
#define EGLEW_GET_VAR(x) (*(const GLboolean*)&x)
#define EGLEW_GET_FUN(x) x
GLEWAPI GLboolean GLEWAPIENTRY eglewGetExtension (const char *name);
#ifdef __cplusplus
}
#endif
#endif /* __eglew_h__ */

View File

@@ -0,0 +1,4 @@
<!-- begin footer.html -->
</td></tr></table></body>
<!-- end footer.html -->

View File

@@ -0,0 +1,135 @@
#include <windows.h>
#ifdef GLEW_STATIC
# ifdef _DEBUG
# define FILENAME "glew32sd.dll"
# else
# define FILENAME "glew32s.dll"
# endif
#else
# ifdef _DEBUG
# define FILENAME "glew32d.dll"
# else
# define FILENAME "glew32.dll"
# endif
#endif
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION GLEW_MAJOR, GLEW_MINOR, GLEW_MICRO, 0
PRODUCTVERSION GLEW_MAJOR, GLEW_MINOR, GLEW_MICRO, 0
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
#ifdef _DEBUG
FILEFLAGS VS_FF_DEBUG
#else
FILEFLAGS 0x0L
#endif
FILEOS VOS__WINDOWS32
#ifdef GLEW_STATIC
FILETYPE VFT_STATIC_LIB
#else
FILETYPE VFT_DLL
#endif
FILESUBTYPE VFT2_UNKNOWN
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "Comments",
"The OpenGL Extension Wrangler Library\r\n"
"Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>\r\n"
"Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>\r\n"
"Copyright (C) 2002, Lev Povalahev\r\n"
"All rights reserved.\r\n"
"\r\n"
"Redistribution and use in source and binary forms, with or without \r\n"
"modification, are permitted provided that the following conditions are met:\r\n"
"\r\n"
"* Redistributions of source code must retain the above copyright notice, \r\n"
" this list of conditions and the following disclaimer.\r\n"
"* Redistributions in binary form must reproduce the above copyright notice, \r\n"
" this list of conditions and the following disclaimer in the documentation \r\n"
" and/or other materials provided with the distribution.\r\n"
"* The name of the author may be used to endorse or promote products \r\n"
" derived from this software without specific prior written permission.\r\n"
"\r\n"
"THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ''AS IS'' \r\n"
"AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE \r\n"
"IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r\n"
"ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE \r\n"
"LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR \r\n"
"CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF \r\n"
"SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r\n"
"INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r\n"
"CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n"
"ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF\r\n"
"THE POSSIBILITY OF SUCH DAMAGE.\r\n"
"\r\n"
"\r\n"
"Mesa 3-D graphics library\r\n"
"\r\n"
"Version: 7.0\r\n"
"\r\n"
"Copyright (C) 1999-2007 Brian Paul All Rights Reserved.\r\n"
"\r\n"
"Permission is hereby granted, free of charge, to any person obtaining a\r\n"
"copy of this software and associated documentation files (the ''Software''),\r\n"
"to deal in the Software without restriction, including without limitation\r\n"
"the rights to use, copy, modify, merge, publish, distribute, sublicense,\r\n"
"and/or sell copies of the Software, and to permit persons to whom the\r\n"
"Software is furnished to do so, subject to the following conditions:\r\n"
"\r\n"
"The above copyright notice and this permission notice shall be included\r\n"
"in all copies or substantial portions of the Software.\r\n"
"\r\n"
"THE SOFTWARE IS PROVIDED ''AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS\r\n"
"OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n"
"FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\r\n"
"BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\r\n"
"AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r\n"
"CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n"
"\r\n"
"\r\n"
"Copyright (c) 2007 The Khronos Group Inc.\r\n"
"\r\n"
"Permission is hereby granted, free of charge, to any person obtaining a\r\n"
"copy of this software and/or associated documentation files (the\r\n"
"''Materials''), to deal in the Materials without restriction, including\r\n"
"without limitation the rights to use, copy, modify, merge, publish,\r\n"
"distribute, sublicense, and/or sell copies of the Materials, and to\r\n"
"permit persons to whom the Materials are furnished to do so, subject to\r\n"
"the following conditions:\r\n"
"\r\n"
"The above copyright notice and this permission notice shall be included\r\n"
"in all copies or substantial portions of the Materials.\r\n"
"\r\n"
"THE MATERIALS ARE PROVIDED ''AS IS'', WITHOUT WARRANTY OF ANY KIND,\r\n"
"EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\n"
"MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\r\n"
"IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\r\n"
"CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\r\n"
"TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\r\n"
"MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.\0"
VALUE "CompanyName", "\0"
VALUE "FileDescription", "The OpenGL Extension Wrangler Library\0"
VALUE "FileVersion", "GLEW_MAJOR,GLEW_MINOR,GLEW_MICRO,0\0"
VALUE "InternalName", "GLEW\0"
VALUE "LegalCopyright", "<22> 2002-2008 Milan Ikits & Marcelo Magallon\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", FILENAME "\0"
VALUE "PrivateBuild", "\0"
VALUE "ProductName", "The OpenGL Extension Wrangler Library\0"
VALUE "ProductVersion", "GLEW_MAJOR,GLEW_MINOR,GLEW_MICRO,0\0"
VALUE "SpecialBuild", "\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END

View File

@@ -0,0 +1,289 @@
#ifndef GLEW_INCLUDE
#include <GL/glew.h>
#else
#include GLEW_INCLUDE
#endif
#if defined(GLEW_OSMESA)
# define GLAPI extern
# include <GL/osmesa.h>
#elif defined(GLEW_EGL)
# include <GL/eglew.h>
#elif defined(_WIN32)
/*
* If NOGDI is defined, wingdi.h won't be included by windows.h, and thus
* wglGetProcAddress won't be declared. It will instead be implicitly declared,
* potentially incorrectly, which we don't want.
*/
# if defined(NOGDI)
# undef NOGDI
# endif
# include <GL/wglew.h>
#elif !defined(__ANDROID__) && !defined(__native_client__) && !defined(__HAIKU__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX))
# include <GL/glxew.h>
#endif
#include <stddef.h> /* For size_t */
#if defined(GLEW_EGL)
#elif defined(GLEW_REGAL)
/* In GLEW_REGAL mode we call direcly into the linked
libRegal.so glGetProcAddressREGAL for looking up
the GL function pointers. */
# undef glGetProcAddressREGAL
# ifdef WIN32
extern void * __stdcall glGetProcAddressREGAL(const GLchar *name);
static void * (__stdcall * regalGetProcAddress) (const GLchar *) = glGetProcAddressREGAL;
# else
extern void * glGetProcAddressREGAL(const GLchar *name);
static void * (*regalGetProcAddress) (const GLchar *) = glGetProcAddressREGAL;
# endif
# define glGetProcAddressREGAL GLEW_GET_FUN(__glewGetProcAddressREGAL)
#elif defined(__sgi) || defined (__sun) || defined(__HAIKU__) || defined(GLEW_APPLE_GLX)
#include <dlfcn.h>
#include <stdio.h>
#include <stdlib.h>
void* dlGetProcAddress (const GLubyte* name)
{
static void* h = NULL;
static void* gpa;
if (h == NULL)
{
if ((h = dlopen(NULL, RTLD_LAZY | RTLD_LOCAL)) == NULL) return NULL;
gpa = dlsym(h, "glXGetProcAddress");
}
if (gpa != NULL)
return ((void*(*)(const GLubyte*))gpa)(name);
else
return dlsym(h, (const char*)name);
}
#endif /* __sgi || __sun || GLEW_APPLE_GLX */
#if defined(__APPLE__)
#include <stdlib.h>
#include <string.h>
#include <AvailabilityMacros.h>
#ifdef MAC_OS_X_VERSION_10_3
#include <dlfcn.h>
void* NSGLGetProcAddress (const GLubyte *name)
{
static void* image = NULL;
void* addr;
if (NULL == image)
{
image = dlopen("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL", RTLD_LAZY);
}
if( !image ) return NULL;
addr = dlsym(image, (const char*)name);
if( addr ) return addr;
#ifdef GLEW_APPLE_GLX
return dlGetProcAddress( name ); // try next for glx symbols
#else
return NULL;
#endif
}
#else
#include <mach-o/dyld.h>
void* NSGLGetProcAddress (const GLubyte *name)
{
static const struct mach_header* image = NULL;
NSSymbol symbol;
char* symbolName;
if (NULL == image)
{
image = NSAddImage("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL", NSADDIMAGE_OPTION_RETURN_ON_ERROR);
}
/* prepend a '_' for the Unix C symbol mangling convention */
symbolName = malloc(strlen((const char*)name) + 2);
strcpy(symbolName+1, (const char*)name);
symbolName[0] = '_';
symbol = NULL;
/* if (NSIsSymbolNameDefined(symbolName))
symbol = NSLookupAndBindSymbol(symbolName); */
symbol = image ? NSLookupSymbolInImage(image, symbolName, NSLOOKUPSYMBOLINIMAGE_OPTION_BIND | NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR) : NULL;
free(symbolName);
if( symbol ) return NSAddressOfSymbol(symbol);
#ifdef GLEW_APPLE_GLX
return dlGetProcAddress( name ); // try next for glx symbols
#else
return NULL;
#endif
}
#endif /* MAC_OS_X_VERSION_10_3 */
#endif /* __APPLE__ */
/*
* Define glewGetProcAddress.
*/
#if defined(GLEW_REGAL)
# define glewGetProcAddress(name) regalGetProcAddress((const GLchar *)name)
#elif defined(GLEW_OSMESA)
# define glewGetProcAddress(name) OSMesaGetProcAddress((const char *)name)
#elif defined(GLEW_EGL)
# define glewGetProcAddress(name) eglGetProcAddress((const char *)name)
#elif defined(_WIN32)
# define glewGetProcAddress(name) wglGetProcAddress((LPCSTR)name)
#elif defined(__APPLE__) && !defined(GLEW_APPLE_GLX)
# define glewGetProcAddress(name) NSGLGetProcAddress(name)
#elif defined(__sgi) || defined(__sun) || defined(__HAIKU__)
# define glewGetProcAddress(name) dlGetProcAddress(name)
#elif defined(__ANDROID__)
# define glewGetProcAddress(name) NULL /* TODO */
#elif defined(__native_client__)
# define glewGetProcAddress(name) NULL /* TODO */
#else /* __linux */
# define glewGetProcAddress(name) (*glXGetProcAddressARB)(name)
#endif
/*
* Redefine GLEW_GET_VAR etc without const cast
*/
#undef GLEW_GET_VAR
# define GLEW_GET_VAR(x) (x)
#ifdef WGLEW_GET_VAR
# undef WGLEW_GET_VAR
# define WGLEW_GET_VAR(x) (x)
#endif /* WGLEW_GET_VAR */
#ifdef GLXEW_GET_VAR
# undef GLXEW_GET_VAR
# define GLXEW_GET_VAR(x) (x)
#endif /* GLXEW_GET_VAR */
#ifdef EGLEW_GET_VAR
# undef EGLEW_GET_VAR
# define EGLEW_GET_VAR(x) (x)
#endif /* EGLEW_GET_VAR */
/*
* GLEW, just like OpenGL or GLU, does not rely on the standard C library.
* These functions implement the functionality required in this file.
*/
static GLuint _glewStrLen (const GLubyte* s)
{
GLuint i=0;
if (s == NULL) return 0;
while (s[i] != '\0') i++;
return i;
}
static GLuint _glewStrCLen (const GLubyte* s, GLubyte c)
{
GLuint i=0;
if (s == NULL) return 0;
while (s[i] != '\0' && s[i] != c) i++;
return i;
}
static GLuint _glewStrCopy(char *d, const char *s, char c)
{
GLuint i=0;
if (s == NULL) return 0;
while (s[i] != '\0' && s[i] != c) { d[i] = s[i]; i++; }
d[i] = '\0';
return i;
}
#if !defined(GLEW_OSMESA)
#if !defined(__APPLE__) || defined(GLEW_APPLE_GLX)
static GLboolean _glewStrSame (const GLubyte* a, const GLubyte* b, GLuint n)
{
GLuint i=0;
if(a == NULL || b == NULL)
return (a == NULL && b == NULL && n == 0) ? GL_TRUE : GL_FALSE;
while (i < n && a[i] != '\0' && b[i] != '\0' && a[i] == b[i]) i++;
return i == n ? GL_TRUE : GL_FALSE;
}
#endif
#endif
static GLboolean _glewStrSame1 (const GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb)
{
while (*na > 0 && (**a == ' ' || **a == '\n' || **a == '\r' || **a == '\t'))
{
(*a)++;
(*na)--;
}
if(*na >= nb)
{
GLuint i=0;
while (i < nb && (*a)+i != NULL && b+i != NULL && (*a)[i] == b[i]) i++;
if(i == nb)
{
*a = *a + nb;
*na = *na - nb;
return GL_TRUE;
}
}
return GL_FALSE;
}
static GLboolean _glewStrSame2 (const GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb)
{
if(*na >= nb)
{
GLuint i=0;
while (i < nb && (*a)+i != NULL && b+i != NULL && (*a)[i] == b[i]) i++;
if(i == nb)
{
*a = *a + nb;
*na = *na - nb;
return GL_TRUE;
}
}
return GL_FALSE;
}
static GLboolean _glewStrSame3 (const GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb)
{
if(*na >= nb)
{
GLuint i=0;
while (i < nb && (*a)+i != NULL && b+i != NULL && (*a)[i] == b[i]) i++;
if (i == nb && (*na == nb || (*a)[i] == ' ' || (*a)[i] == '\n' || (*a)[i] == '\r' || (*a)[i] == '\t'))
{
*a = *a + nb;
*na = *na - nb;
return GL_TRUE;
}
}
return GL_FALSE;
}
/*
* Search for name in the extensions string. Use of strstr()
* is not sufficient because extension names can be prefixes of
* other extension names. Could use strtok() but the constant
* string returned by glGetString might be in read-only memory.
*/
#if !defined(GLEW_OSMESA)
#if !defined(__APPLE__) || defined(GLEW_APPLE_GLX)
static GLboolean _glewSearchExtension (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 += n+1;
}
return GL_FALSE;
}
#endif
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,45 @@
/* ------------------------------------------------------------------------ */
GLboolean eglewGetExtension (const char* name)
{
const GLubyte* start;
const GLubyte* end;
start = (const GLubyte*) eglQueryString(eglGetCurrentDisplay(), EGL_EXTENSIONS);
if (0 == start) return GL_FALSE;
end = start + _glewStrLen(start);
return _glewSearchExtension(name, start, end);
}
GLenum eglewInit (EGLDisplay display)
{
EGLint major, minor;
const GLubyte* extStart;
const GLubyte* extEnd;
PFNEGLINITIALIZEPROC initialize = NULL;
PFNEGLQUERYSTRINGPROC queryString = NULL;
/* Load necessary entry points */
initialize = (PFNEGLINITIALIZEPROC) glewGetProcAddress("eglInitialize");
queryString = (PFNEGLQUERYSTRINGPROC) glewGetProcAddress("eglQueryString");
if (!initialize || !queryString)
return 1;
/* query EGK version */
if (initialize(display, &major, &minor) != EGL_TRUE)
return 1;
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*) queryString(display, EGL_EXTENSIONS);
if (extStart == 0)
extStart = (const GLubyte *)"";
extEnd = extStart + _glewStrLen(extStart);
/* initialize extensions */

View File

@@ -0,0 +1,207 @@
/* ------------------------------------------------------------------------- */
static int _glewExtensionCompare(const char *s1, const char *s2)
{
/* http://www.chanduthedev.com/2012/07/strcmp-implementation-in-c.html */
while (*s1 || *s2)
{
if (*s1 > *s2)
return 1;
if (*s1 < *s2)
return -1;
s1++;
s2++;
}
return 0;
}
static ptrdiff_t _glewBsearchExtension(const char* name)
{
ptrdiff_t lo = 0, hi = sizeof(_glewExtensionLookup) / sizeof(char*) - 2;
while (lo <= hi)
{
ptrdiff_t mid = (lo + hi) / 2;
const int cmp = _glewExtensionCompare(name, _glewExtensionLookup[mid]);
if (cmp < 0) hi = mid - 1;
else if (cmp > 0) lo = mid + 1;
else return mid;
}
return -1;
}
static GLboolean *_glewGetExtensionString(const char *name)
{
ptrdiff_t n = _glewBsearchExtension(name);
if (n >= 0) return &_glewExtensionString[n];
return NULL;
}
static GLboolean *_glewGetExtensionEnable(const char *name)
{
ptrdiff_t n = _glewBsearchExtension(name);
if (n >= 0) return _glewExtensionEnabled[n];
return NULL;
}
static const char *_glewNextSpace(const char *i)
{
const char *j = i;
if (j)
while (*j!=' ' && *j) ++j;
return j;
}
static const char *_glewNextNonSpace(const char *i)
{
const char *j = i;
if (j)
while (*j==' ') ++j;
return j;
}
GLboolean GLEWAPIENTRY glewGetExtension (const char* name)
{
GLboolean *enable = _glewGetExtensionString(name);
if (enable)
return *enable;
return GL_FALSE;
}
/* ------------------------------------------------------------------------- */
typedef const GLubyte* (GLAPIENTRY * PFNGLGETSTRINGPROC) (GLenum name);
typedef void (GLAPIENTRY * PFNGLGETINTEGERVPROC) (GLenum pname, GLint *params);
static GLenum GLEWAPIENTRY glewContextInit ()
{
PFNGLGETSTRINGPROC getString;
const GLubyte* s;
GLuint dot;
GLint major, minor;
size_t n;
#ifdef _WIN32
getString = glGetString;
#else
getString = (PFNGLGETSTRINGPROC) glewGetProcAddress((const GLubyte*)"glGetString");
if (!getString)
return GLEW_ERROR_NO_GL_VERSION;
#endif
/* query opengl version */
s = getString(GL_VERSION);
dot = _glewStrCLen(s, '.');
if (dot == 0)
return GLEW_ERROR_NO_GL_VERSION;
major = s[dot-1]-'0';
minor = s[dot+1]-'0';
if (minor < 0 || minor > 9)
minor = 0;
if (major<0 || major>9)
return GLEW_ERROR_NO_GL_VERSION;
if (major == 1 && minor == 0)
{
return GLEW_ERROR_GL_VERSION_10_ONLY;
}
else
{
GLEW_VERSION_4_6 = ( major > 4 ) || ( major == 4 && minor >= 6 ) ? GL_TRUE : GL_FALSE;
GLEW_VERSION_4_5 = GLEW_VERSION_4_4 == GL_TRUE || ( major == 4 && minor >= 5 ) ? GL_TRUE : GL_FALSE;
GLEW_VERSION_4_4 = GLEW_VERSION_4_5 == GL_TRUE || ( major == 4 && minor >= 4 ) ? GL_TRUE : GL_FALSE;
GLEW_VERSION_4_3 = GLEW_VERSION_4_4 == GL_TRUE || ( major == 4 && minor >= 3 ) ? GL_TRUE : GL_FALSE;
GLEW_VERSION_4_2 = GLEW_VERSION_4_3 == GL_TRUE || ( major == 4 && minor >= 2 ) ? GL_TRUE : GL_FALSE;
GLEW_VERSION_4_1 = GLEW_VERSION_4_2 == GL_TRUE || ( major == 4 && minor >= 1 ) ? GL_TRUE : GL_FALSE;
GLEW_VERSION_4_0 = GLEW_VERSION_4_1 == GL_TRUE || ( major == 4 ) ? GL_TRUE : GL_FALSE;
GLEW_VERSION_3_3 = GLEW_VERSION_4_0 == GL_TRUE || ( major == 3 && minor >= 3 ) ? GL_TRUE : GL_FALSE;
GLEW_VERSION_3_2 = GLEW_VERSION_3_3 == GL_TRUE || ( major == 3 && minor >= 2 ) ? GL_TRUE : GL_FALSE;
GLEW_VERSION_3_1 = GLEW_VERSION_3_2 == GL_TRUE || ( major == 3 && minor >= 1 ) ? GL_TRUE : GL_FALSE;
GLEW_VERSION_3_0 = GLEW_VERSION_3_1 == GL_TRUE || ( major == 3 ) ? GL_TRUE : GL_FALSE;
GLEW_VERSION_2_1 = GLEW_VERSION_3_0 == GL_TRUE || ( major == 2 && minor >= 1 ) ? GL_TRUE : GL_FALSE;
GLEW_VERSION_2_0 = GLEW_VERSION_2_1 == GL_TRUE || ( major == 2 ) ? GL_TRUE : GL_FALSE;
GLEW_VERSION_1_5 = GLEW_VERSION_2_0 == GL_TRUE || ( major == 1 && minor >= 5 ) ? GL_TRUE : GL_FALSE;
GLEW_VERSION_1_4 = GLEW_VERSION_1_5 == GL_TRUE || ( major == 1 && minor >= 4 ) ? GL_TRUE : GL_FALSE;
GLEW_VERSION_1_3 = GLEW_VERSION_1_4 == GL_TRUE || ( major == 1 && minor >= 3 ) ? GL_TRUE : GL_FALSE;
GLEW_VERSION_1_2_1 = GLEW_VERSION_1_3 == GL_TRUE ? GL_TRUE : GL_FALSE;
GLEW_VERSION_1_2 = GLEW_VERSION_1_2_1 == GL_TRUE || ( major == 1 && minor >= 2 ) ? GL_TRUE : GL_FALSE;
GLEW_VERSION_1_1 = GLEW_VERSION_1_2 == GL_TRUE || ( major == 1 && minor >= 1 ) ? GL_TRUE : GL_FALSE;
}
for (n = 0; n < sizeof(_glewExtensionString) / sizeof(_glewExtensionString[0]); ++n)
_glewExtensionString[n] = GL_FALSE;
if (GLEW_VERSION_3_0)
{
GLint n = 0;
GLint i;
PFNGLGETINTEGERVPROC getIntegerv;
PFNGLGETSTRINGIPROC getStringi;
const char *ext;
GLboolean *enable;
#ifdef _WIN32
getIntegerv = glGetIntegerv;
#else
getIntegerv = (PFNGLGETINTEGERVPROC) glewGetProcAddress((const GLubyte*)"glGetIntegerv");
#endif
if (getIntegerv)
getIntegerv(GL_NUM_EXTENSIONS, &n);
/* glGetStringi is OpenGL 3.0 */
getStringi = (PFNGLGETSTRINGIPROC) glewGetProcAddress((const GLubyte*)"glGetStringi");
if (getStringi)
for (i = 0; i<n; ++i)
{
ext = (const char *) getStringi(GL_EXTENSIONS, i);
/* Based on extension string(s), glewGetExtension purposes */
enable = _glewGetExtensionString(ext);
if (enable)
*enable = GL_TRUE;
/* Based on extension string(s), experimental mode, glewIsSupported purposes */
enable = _glewGetExtensionEnable(ext);
if (enable)
*enable = GL_TRUE;
}
}
else
{
const char *extensions;
const char *end;
const char *i;
const char *j;
char ext[128];
GLboolean *enable;
extensions = (const char *) getString(GL_EXTENSIONS);
if (extensions)
{
end = extensions + _glewStrLen((const GLubyte *) extensions);
for (i=extensions; i<end; i = j + 1)
{
i = _glewNextNonSpace(i);
j = _glewNextSpace(i);
/* Copy extension into NUL terminated string */
if (j-i >= (ptrdiff_t) sizeof(ext))
continue;
_glewStrCopy(ext, i, ' ');
/* Based on extension string(s), glewGetExtension purposes */
enable = _glewGetExtensionString(ext);
if (enable)
*enable = GL_TRUE;
/* Based on extension string(s), experimental mode, glewIsSupported purposes */
enable = _glewGetExtensionEnable(ext);
if (enable)
*enable = GL_TRUE;
}
}
}

View File

@@ -0,0 +1,57 @@
/* ------------------------------------------------------------------------ */
GLboolean glxewGetExtension (const char* name)
{
const GLubyte* start;
const GLubyte* end;
if (glXGetCurrentDisplay == NULL) return GL_FALSE;
start = (const GLubyte*)glXGetClientString(glXGetCurrentDisplay(), GLX_EXTENSIONS);
if (0 == start) return GL_FALSE;
end = start + _glewStrLen(start);
return _glewSearchExtension(name, start, end);
}
GLenum glxewInit ()
{
Display* display;
int major, minor;
const GLubyte* extStart;
const GLubyte* extEnd;
/* initialize core GLX 1.2 */
if (_glewInit_GLX_VERSION_1_2()) return GLEW_ERROR_GLX_VERSION_11_ONLY;
/* check for a display */
display = glXGetCurrentDisplay();
if (display == NULL) return GLEW_ERROR_NO_GLX_DISPLAY;
/* initialize flags */
GLXEW_VERSION_1_0 = GL_TRUE;
GLXEW_VERSION_1_1 = GL_TRUE;
GLXEW_VERSION_1_2 = GL_TRUE;
GLXEW_VERSION_1_3 = GL_TRUE;
GLXEW_VERSION_1_4 = GL_TRUE;
/* query GLX version */
glXQueryVersion(display, &major, &minor);
if (major == 1 && minor <= 3)
{
switch (minor)
{
case 3:
GLXEW_VERSION_1_4 = GL_FALSE;
break;
case 2:
GLXEW_VERSION_1_4 = GL_FALSE;
GLXEW_VERSION_1_3 = GL_FALSE;
break;
default:
return GLEW_ERROR_GLX_VERSION_11_ONLY;
break;
}
}
/* query GLX extension string */
extStart = 0;
if (glXGetCurrentDisplay != NULL)
extStart = (const GLubyte*)glXGetClientString(display, GLX_EXTENSIONS);
if (extStart == 0)
extStart = (const GLubyte *)"";
extEnd = extStart + _glewStrLen(extStart);
/* initialize extensions */

View File

@@ -0,0 +1,67 @@
/* ------------------------------------------------------------------------ */
const GLubyte * GLEWAPIENTRY glewGetErrorString (GLenum error)
{
static const GLubyte* _glewErrorString[] =
{
(const GLubyte*)"No error",
(const GLubyte*)"Missing GL version",
(const GLubyte*)"GL 1.1 and up are not supported",
(const GLubyte*)"GLX 1.2 and up are not supported",
(const GLubyte*)"Unknown error"
};
const size_t max_error = sizeof(_glewErrorString)/sizeof(*_glewErrorString) - 1;
return _glewErrorString[(size_t)error > max_error ? max_error : (size_t)error];
}
const GLubyte * GLEWAPIENTRY glewGetString (GLenum name)
{
static const GLubyte* _glewString[] =
{
(const GLubyte*)NULL,
(const GLubyte*)"GLEW_VERSION_STRING",
(const GLubyte*)"GLEW_VERSION_MAJOR_STRING",
(const GLubyte*)"GLEW_VERSION_MINOR_STRING",
(const GLubyte*)"GLEW_VERSION_MICRO_STRING"
};
const size_t max_string = sizeof(_glewString)/sizeof(*_glewString) - 1;
return _glewString[(size_t)name > max_string ? 0 : (size_t)name];
}
/* ------------------------------------------------------------------------ */
GLboolean glewExperimental = GL_FALSE;
GLenum GLEWAPIENTRY glewInit (void)
{
GLenum r;
#if defined(GLEW_EGL)
PFNEGLGETCURRENTDISPLAYPROC getCurrentDisplay = NULL;
#endif
r = glewContextInit();
if ( r != 0 ) return r;
#if defined(GLEW_EGL)
getCurrentDisplay = (PFNEGLGETCURRENTDISPLAYPROC) glewGetProcAddress("eglGetCurrentDisplay");
return eglewInit(getCurrentDisplay());
#elif defined(GLEW_OSMESA) || defined(__ANDROID__) || defined(__native_client__) || defined(__HAIKU__)
return r;
#elif defined(_WIN32)
return wglewInit();
#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX) /* _UNIX */
return glxewInit();
#else
return r;
#endif /* _WIN32 */
}
#if defined(_WIN32) && defined(GLEW_BUILD) && defined(__GNUC__)
/* GCC requires a DLL entry point even without any standard library included. */
/* Types extracted from windows.h to avoid polluting the rest of the file. */
int __stdcall DllMainCRTStartup(void* instance, unsigned reason, void* reserved)
{
(void) instance;
(void) reason;
(void) reserved;
return 1;
}
#endif

View File

@@ -0,0 +1,41 @@
/* ------------------------------------------------------------------------- */
static PFNWGLGETEXTENSIONSSTRINGARBPROC _wglewGetExtensionsStringARB = NULL;
static PFNWGLGETEXTENSIONSSTRINGEXTPROC _wglewGetExtensionsStringEXT = NULL;
GLboolean GLEWAPIENTRY wglewGetExtension (const char* name)
{
const GLubyte* start;
const GLubyte* end;
if (_wglewGetExtensionsStringARB == NULL)
if (_wglewGetExtensionsStringEXT == NULL)
return GL_FALSE;
else
start = (const GLubyte*)_wglewGetExtensionsStringEXT();
else
start = (const GLubyte*)_wglewGetExtensionsStringARB(wglGetCurrentDC());
if (start == 0)
return GL_FALSE;
end = start + _glewStrLen(start);
return _glewSearchExtension(name, start, end);
}
GLenum GLEWAPIENTRY wglewInit ()
{
GLboolean crippled;
const GLubyte* extStart;
const GLubyte* extEnd;
/* find wgl extension string query functions */
_wglewGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringARB");
_wglewGetExtensionsStringEXT = (PFNWGLGETEXTENSIONSSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringEXT");
/* query wgl extension string */
if (_wglewGetExtensionsStringARB == NULL)
if (_wglewGetExtensionsStringEXT == NULL)
extStart = (const GLubyte*)"";
else
extStart = (const GLubyte*)_wglewGetExtensionsStringEXT();
else
extStart = (const GLubyte*)_wglewGetExtensionsStringARB(wglGetCurrentDC());
extEnd = extStart + _glewStrLen(extStart);
/* initialize extensions */
crippled = _wglewGetExtensionsStringARB == NULL && _wglewGetExtensionsStringEXT == NULL;

View File

@@ -0,0 +1,32 @@
/*
** The OpenGL Extension Wrangler Library
** Copyright (C) 2008-2017, Nigel Stewart <nigels[]users sourceforge net>
** Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
** Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
** Copyright (C) 2002, Lev Povalahev
** All rights reserved.
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are met:
**
** * Redistributions of source code must retain the above copyright notice,
** this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright notice,
** this list of conditions and the following disclaimer in the documentation
** and/or other materials provided with the distribution.
** * The name of the author may be used to endorse or promote products
** derived from this software without specific prior written permission.
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
** THE POSSIBILITY OF SUCH DAMAGE.
*/

View File

@@ -0,0 +1,17 @@
}
ret = (len == 0);
}
return ret;
}
#elif defined(GLEW_EGL)
GLboolean eglewIsSupported (const char* name)
{
const GLubyte* pos = (const GLubyte*)name;
GLuint len = _glewStrLen(pos);
GLboolean ret = GL_TRUE;
while (ret && len > 0)
{
if(_glewStrSame1(&pos, &len, (const GLubyte*)"EGL_", 4))
{

View File

@@ -0,0 +1,17 @@
}
ret = (len == 0);
}
return ret;
}
#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)
{
const GLubyte* pos = (const GLubyte*)name;
GLuint len = _glewStrLen(pos);
GLboolean ret = GL_TRUE;
while (ret && len > 0)
{
if(_glewStrSame1(&pos, &len, (const GLubyte*)"GLX_", 4))
{

View File

@@ -0,0 +1,9 @@
GLboolean GLEWAPIENTRY glewIsSupported (const char* name)
{
const GLubyte* pos = (const GLubyte*)name;
GLuint len = _glewStrLen(pos);
GLboolean ret = GL_TRUE;
while (ret && len > 0)
{
if (_glewStrSame1(&pos, &len, (const GLubyte*)"GL_", 3))
{

View File

@@ -0,0 +1,7 @@
}
ret = (len == 0);
}
return ret;
}
#endif /* _WIN32 */

View File

@@ -0,0 +1,17 @@
}
ret = (len == 0);
}
return ret;
}
#if defined(_WIN32) && !defined(GLEW_EGL) && !defined(GLEW_OSMESA)
GLboolean GLEWAPIENTRY wglewIsSupported (const char* name)
{
const GLubyte* pos = (const GLubyte*)name;
GLuint len = _glewStrLen(pos);
GLboolean ret = GL_TRUE;
while (ret && len > 0)
{
if (_glewStrSame1(&pos, &len, (const GLubyte*)"WGL_", 4))
{

View File

@@ -0,0 +1,68 @@
/* ------------------------------------------------------------------------- */
/* error codes */
#define GLEW_OK 0
#define GLEW_NO_ERROR 0
#define GLEW_ERROR_NO_GL_VERSION 1 /* missing GL version */
#define GLEW_ERROR_GL_VERSION_10_ONLY 2 /* Need at least OpenGL 1.1 */
#define GLEW_ERROR_GLX_VERSION_11_ONLY 3 /* Need at least GLX 1.2 */
#define GLEW_ERROR_NO_GLX_DISPLAY 4 /* Need GLX display for GLX support */
/* string codes */
#define GLEW_VERSION 1
#define GLEW_VERSION_MAJOR 2
#define GLEW_VERSION_MINOR 3
#define GLEW_VERSION_MICRO 4
/* ------------------------------------------------------------------------- */
/* GLEW version info */
/*
VERSION GLEW_VERSION_STRING
VERSION_MAJOR GLEW_VERSION_MAJOR_STRING
VERSION_MINOR GLEW_VERSION_MINOR_STRING
VERSION_MICRO GLEW_VERSION_MICRO_STRING
*/
/* API */
GLEWAPI GLenum GLEWAPIENTRY glewInit (void);
GLEWAPI GLboolean GLEWAPIENTRY glewIsSupported (const char *name);
#define glewIsExtensionSupported(x) glewIsSupported(x)
#ifndef GLEW_GET_VAR
#define GLEW_GET_VAR(x) (*(const GLboolean*)&x)
#endif
#ifndef GLEW_GET_FUN
#define GLEW_GET_FUN(x) x
#endif
GLEWAPI GLboolean glewExperimental;
GLEWAPI GLboolean GLEWAPIENTRY glewGetExtension (const char *name);
GLEWAPI const GLubyte * GLEWAPIENTRY glewGetErrorString (GLenum error);
GLEWAPI const GLubyte * GLEWAPIENTRY glewGetString (GLenum name);
#ifdef __cplusplus
}
#endif
#ifdef GLEW_APIENTRY_DEFINED
#undef GLEW_APIENTRY_DEFINED
#undef APIENTRY
#endif
#ifdef GLEW_CALLBACK_DEFINED
#undef GLEW_CALLBACK_DEFINED
#undef CALLBACK
#endif
#ifdef GLEW_WINGDIAPI_DEFINED
#undef GLEW_WINGDIAPI_DEFINED
#undef WINGDIAPI
#endif
#undef GLAPI
/* #undef GLEWAPI */
#endif /* __glew_h__ */

View File

@@ -0,0 +1,123 @@
#include <windows.h>
#ifdef _DEBUG
# define FILENAME "glewinfod.exe"
#else
# define FILENAME "glewinfo.exe"
#endif
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION GLEW_MAJOR, GLEW_MINOR, GLEW_MICRO, 0
PRODUCTVERSION GLEW_MAJOR, GLEW_MINOR, GLEW_MICRO, 0
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
#ifdef _DEBUG
FILEFLAGS VS_FF_DEBUG
#else
FILEFLAGS 0x0L
#endif
FILEOS VOS__WINDOWS32
FILETYPE VFT_APP
FILESUBTYPE VFT2_UNKNOWN
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "Comments",
"The OpenGL Extension Wrangler Library\r\n"
"Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>\r\n"
"Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>\r\n"
"Copyright (C) 2002, Lev Povalahev\r\n"
"All rights reserved.\r\n"
"\r\n"
"Redistribution and use in source and binary forms, with or without \r\n"
"modification, are permitted provided that the following conditions are met:\r\n"
"\r\n"
"* Redistributions of source code must retain the above copyright notice, \r\n"
" this list of conditions and the following disclaimer.\r\n"
"* Redistributions in binary form must reproduce the above copyright notice, \r\n"
" this list of conditions and the following disclaimer in the documentation \r\n"
" and/or other materials provided with the distribution.\r\n"
"* The name of the author may be used to endorse or promote products \r\n"
" derived from this software without specific prior written permission.\r\n"
"\r\n"
"THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ''AS IS'' \r\n"
"AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE \r\n"
"IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r\n"
"ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE \r\n"
"LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR \r\n"
"CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF \r\n"
"SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r\n"
"INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r\n"
"CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n"
"ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF\r\n"
"THE POSSIBILITY OF SUCH DAMAGE.\r\n"
"\r\n"
"\r\n"
"Mesa 3-D graphics library\r\n"
"\r\n"
"Version: 7.0\r\n"
"\r\n"
"Copyright (C) 1999-2007 Brian Paul All Rights Reserved.\r\n"
"\r\n"
"Permission is hereby granted, free of charge, to any person obtaining a\r\n"
"copy of this software and associated documentation files (the ''Software''),\r\n"
"to deal in the Software without restriction, including without limitation\r\n"
"the rights to use, copy, modify, merge, publish, distribute, sublicense,\r\n"
"and/or sell copies of the Software, and to permit persons to whom the\r\n"
"Software is furnished to do so, subject to the following conditions:\r\n"
"\r\n"
"The above copyright notice and this permission notice shall be included\r\n"
"in all copies or substantial portions of the Software.\r\n"
"\r\n"
"THE SOFTWARE IS PROVIDED ''AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS\r\n"
"OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n"
"FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\r\n"
"BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\r\n"
"AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r\n"
"CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n"
"\r\n"
"\r\n"
"Copyright (c) 2007 The Khronos Group Inc.\r\n"
"\r\n"
"Permission is hereby granted, free of charge, to any person obtaining a\r\n"
"copy of this software and/or associated documentation files (the\r\n"
"''Materials''), to deal in the Materials without restriction, including\r\n"
"without limitation the rights to use, copy, modify, merge, publish,\r\n"
"distribute, sublicense, and/or sell copies of the Materials, and to\r\n"
"permit persons to whom the Materials are furnished to do so, subject to\r\n"
"the following conditions:\r\n"
"\r\n"
"The above copyright notice and this permission notice shall be included\r\n"
"in all copies or substantial portions of the Materials.\r\n"
"\r\n"
"THE MATERIALS ARE PROVIDED ''AS IS'', WITHOUT WARRANTY OF ANY KIND,\r\n"
"EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\n"
"MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\r\n"
"IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\r\n"
"CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\r\n"
"TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\r\n"
"MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.\0"
VALUE "CompanyName", "\0"
VALUE "FileDescription", "Utility for verifying extension entry points\0"
VALUE "FileVersion", "GLEW_MAJOR,GLEW_MINOR,GLEW_MICRO,0\0"
VALUE "InternalName", "glewinfo\0"
VALUE "LegalCopyright", "<22> 2002-2008 Milan Ikits & Marcelo Magallon\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", FILENAME "\0"
VALUE "PrivateBuild", "\0"
VALUE "ProductName", "The OpenGL Extension Wrangler Library\0"
VALUE "ProductVersion", "GLEW_MAJOR,GLEW_MINOR,GLEW_MICRO,0\0"
VALUE "SpecialBuild", "\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END

View File

@@ -0,0 +1,6 @@
}
#elif defined(GLEW_EGL)
static void eglewInfo ()
{

View File

@@ -0,0 +1,7 @@
/* ------------------------------------------------------------------------ */
static void glewInfo (void)
{
#ifdef GL_VERSION_1_1
_glewInfo_GL_VERSION_1_1();
#endif /* GL_VERSION_1_1 */

View File

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

View File

@@ -0,0 +1,89 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <GL/glew.h>
#if defined(GLEW_EGL)
#include <GL/eglew.h>
#elif defined(GLEW_OSMESA)
#define GLAPI extern
#include <GL/osmesa.h>
#elif defined(_WIN32)
#include <GL/wglew.h>
#elif !defined(__APPLE__) && !defined(__HAIKU__) || defined(GLEW_APPLE_GLX)
#include <GL/glxew.h>
#endif
#if defined(__APPLE__)
#include <AvailabilityMacros.h>
#endif
#ifdef GLEW_REGAL
#include <GL/Regal.h>
#endif
static FILE* f;
/* Command-line parameters for GL context creation */
struct createParams
{
#if defined(GLEW_OSMESA)
#elif defined(GLEW_EGL)
#elif defined(_WIN32)
int pixelformat;
#elif !defined(__APPLE__) && !defined(__HAIKU__) || defined(GLEW_APPLE_GLX)
const char* display;
int visual;
#endif
int major, minor; /* GL context version number */
/* https://www.opengl.org/registry/specs/ARB/glx_create_context.txt */
int profile; /* core = 1, compatibility = 2 */
int flags; /* debug = 1, forward compatible = 2 */
};
GLboolean glewCreateContext (struct createParams *params);
GLboolean glewParseArgs (int argc, char** argv, struct createParams *);
void glewDestroyContext ();
/* ------------------------------------------------------------------------- */
static void glewPrintExt (const char* name, GLboolean def1, GLboolean def2, GLboolean def3)
{
unsigned int i;
fprintf(f, "\n%s:", name);
for (i=0; i<62-strlen(name); i++) fprintf(f, " ");
fprintf(f, "%s ", def1 ? "OK" : "MISSING");
if (def1 != def2)
fprintf(f, "[%s] ", def2 ? "OK" : "MISSING");
if (def1 != def3)
fprintf(f, "[%s]\n", def3 ? "OK" : "MISSING");
else
fprintf(f, "\n");
for (i=0; i<strlen(name)+1; i++) fprintf(f, "-");
fprintf(f, "\n");
fflush(f);
}
static void glewInfoFunc (const char* name, GLint undefined)
{
unsigned int i;
fprintf(f, " %s:", name);
for (i=0; i<60-strlen(name); i++) fprintf(f, " ");
fprintf(f, "%s\n", undefined ? "MISSING" : "OK");
fflush(f);
}
/* ----------------------------- GL_VERSION_1_1 ---------------------------- */
#ifdef GL_VERSION_1_1
static void _glewInfo_GL_VERSION_1_1 (void)
{
glewPrintExt("GL_VERSION_1_1", GLEW_VERSION_1_1, GLEW_VERSION_1_1, GLEW_VERSION_1_1);
}
#endif /* GL_VERSION_1_1 */

View File

@@ -0,0 +1,598 @@
}
#endif /* _WIN32 */
/* ------------------------------------------------------------------------ */
int main (int argc, char** argv)
{
GLuint err;
struct createParams params =
{
#if defined(GLEW_OSMESA)
#elif defined(GLEW_EGL)
#elif defined(_WIN32)
-1, /* pixelformat */
#elif !defined(__HAIKU__) && !defined(__APPLE__) || defined(GLEW_APPLE_GLX)
"", /* display */
-1, /* visual */
#endif
0, /* major */
0, /* minor */
0, /* profile mask */
0 /* flags */
};
#if defined(GLEW_EGL)
typedef const GLubyte* (GLAPIENTRY * PFNGLGETSTRINGPROC) (GLenum name);
PFNGLGETSTRINGPROC getString;
#endif
if (glewParseArgs(argc-1, argv+1, &params))
{
fprintf(stderr, "Usage: glewinfo "
#if defined(GLEW_OSMESA)
#elif defined(GLEW_EGL)
#elif defined(_WIN32)
"[-pf <pixelformat>] "
#elif !defined(__HAIKU__) && !defined(__APPLE__) || defined(GLEW_APPLE_GLX)
"[-display <display>] "
"[-visual <visual id>] "
#endif
"[-version <OpenGL version>] "
"[-profile core|compatibility] "
"[-flag debug|forward]"
"\n");
return 1;
}
if (GL_TRUE == glewCreateContext(&params))
{
fprintf(stderr, "Error: glewCreateContext failed\n");
glewDestroyContext();
return 1;
}
glewExperimental = GL_TRUE;
err = glewInit();
if (GLEW_OK != err)
{
fprintf(stderr, "Error [main]: glewInit failed: %s\n", glewGetErrorString(err));
glewDestroyContext();
return 1;
}
#if defined(GLEW_EGL)
getString = (PFNGLGETSTRINGPROC) eglGetProcAddress("glGetString");
if (!getString)
{
fprintf(stderr, "Error: eglGetProcAddress failed to fetch glGetString\n");
glewDestroyContext();
return 1;
}
#endif
#if defined(_WIN32)
#if defined(_MSC_VER) && (_MSC_VER >= 1400)
if (fopen_s(&f, "glewinfo.txt", "w") != 0)
f = stdout;
#else
f = fopen("glewinfo.txt", "w");
#endif
if (f == NULL) f = stdout;
#else
f = stdout;
#endif
fprintf(f, "---------------------------\n");
fprintf(f, " GLEW Extension Info\n");
fprintf(f, "---------------------------\n\n");
fprintf(f, "GLEW version %s\n", glewGetString(GLEW_VERSION));
#if defined(GLEW_OSMESA)
#elif defined(GLEW_EGL)
#elif defined(_WIN32)
fprintf(f, "Reporting capabilities of pixelformat %d\n", params.pixelformat);
#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX)
fprintf(f, "Reporting capabilities of display %s, visual 0x%x\n",
params.display == NULL ? getenv("DISPLAY") : params.display, params.visual);
#endif
#if defined(GLEW_EGL)
fprintf(f, "Running on a %s from %s\n",
getString(GL_RENDERER), getString(GL_VENDOR));
fprintf(f, "OpenGL version %s is supported\n", getString(GL_VERSION));
#else
fprintf(f, "Running on a %s from %s\n",
glGetString(GL_RENDERER), glGetString(GL_VENDOR));
fprintf(f, "OpenGL version %s is supported\n", glGetString(GL_VERSION));
#endif
glewInfo();
#if defined(GLEW_OSMESA)
#elif defined(GLEW_EGL)
eglewInfo();
#elif defined(_WIN32)
wglewInfo();
#else
glxewInfo();
#endif
if (f != stdout) fclose(f);
glewDestroyContext();
return 0;
}
/* ------------------------------------------------------------------------ */
GLboolean glewParseArgs (int argc, char** argv, struct createParams *params)
{
int p = 0;
while (p < argc)
{
if (!strcmp(argv[p], "-version"))
{
if (++p >= argc) return GL_TRUE;
if (sscanf(argv[p++], "%d.%d", &params->major, &params->minor) != 2) return GL_TRUE;
}
else if (!strcmp(argv[p], "-profile"))
{
if (++p >= argc) return GL_TRUE;
if (strcmp("core", argv[p]) == 0) params->profile |= 1;
else if (strcmp("compatibility",argv[p]) == 0) params->profile |= 2;
else return GL_TRUE;
++p;
}
else if (!strcmp(argv[p], "-flag"))
{
if (++p >= argc) return GL_TRUE;
if (strcmp("debug", argv[p]) == 0) params->flags |= 1;
else if (strcmp("forward",argv[p]) == 0) params->flags |= 2;
else return GL_TRUE;
++p;
}
#if defined(GLEW_OSMESA)
#elif defined(GLEW_EGL)
#elif defined(_WIN32)
else if (!strcmp(argv[p], "-pf") || !strcmp(argv[p], "-pixelformat"))
{
if (++p >= argc) return GL_TRUE;
params->pixelformat = strtol(argv[p++], NULL, 0);
}
#elif !defined(__HAIKU__) && !defined(__APPLE__) || defined(GLEW_APPLE_GLX)
else if (!strcmp(argv[p], "-display"))
{
if (++p >= argc) return GL_TRUE;
params->display = argv[p++];
}
else if (!strcmp(argv[p], "-visual"))
{
if (++p >= argc) return GL_TRUE;
params->visual = (int)strtol(argv[p++], NULL, 0);
}
#endif
else
return GL_TRUE;
}
return GL_FALSE;
}
/* ------------------------------------------------------------------------ */
#if defined(GLEW_EGL)
EGLDisplay display;
EGLContext ctx;
/* See: http://stackoverflow.com/questions/12662227/opengl-es2-0-offscreen-context-for-fbo-rendering */
GLboolean glewCreateContext (struct createParams *params)
{
EGLDeviceEXT devices[1];
EGLint numDevices;
EGLSurface surface;
EGLint majorVersion, minorVersion;
EGLint configAttribs[] = {
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
EGL_RED_SIZE, 1,
EGL_GREEN_SIZE, 1,
EGL_BLUE_SIZE, 1,
EGL_RENDERABLE_TYPE, EGL_OPENGL_BIT,
EGL_NONE
};
static const EGLint contextAttribs[] = {
EGL_CONTEXT_CLIENT_VERSION, 2,
EGL_NONE
};
static const EGLint pBufferAttribs[] = {
EGL_WIDTH, 128,
EGL_HEIGHT, 128,
EGL_NONE
};
EGLConfig config;
EGLint numConfig;
EGLBoolean pBuffer;
PFNEGLQUERYDEVICESEXTPROC queryDevices = NULL;
PFNEGLGETPLATFORMDISPLAYEXTPROC getPlatformDisplay = NULL;
PFNEGLGETERRORPROC getError = NULL;
PFNEGLGETDISPLAYPROC getDisplay = NULL;
PFNEGLINITIALIZEPROC initialize = NULL;
PFNEGLBINDAPIPROC bindAPI = NULL;
PFNEGLCHOOSECONFIGPROC chooseConfig = NULL;
PFNEGLCREATEWINDOWSURFACEPROC createWindowSurface = NULL;
PFNEGLCREATECONTEXTPROC createContext = NULL;
PFNEGLMAKECURRENTPROC makeCurrent = NULL;
PFNEGLCREATEPBUFFERSURFACEPROC createPbufferSurface = NULL;
/* Load necessary entry points */
queryDevices = (PFNEGLQUERYDEVICESEXTPROC) eglGetProcAddress("eglQueryDevicesEXT");
getPlatformDisplay = (PFNEGLGETPLATFORMDISPLAYEXTPROC) eglGetProcAddress("eglGetPlatformDisplayEXT");
getError = (PFNEGLGETERRORPROC) eglGetProcAddress("eglGetError");
getDisplay = (PFNEGLGETDISPLAYPROC) eglGetProcAddress("eglGetDisplay");
initialize = (PFNEGLINITIALIZEPROC) eglGetProcAddress("eglInitialize");
bindAPI = (PFNEGLBINDAPIPROC) eglGetProcAddress("eglBindAPI");
chooseConfig = (PFNEGLCHOOSECONFIGPROC) eglGetProcAddress("eglChooseConfig");
createWindowSurface = (PFNEGLCREATEWINDOWSURFACEPROC) eglGetProcAddress("eglCreateWindowSurface");
createPbufferSurface = (PFNEGLCREATEPBUFFERSURFACEPROC) eglGetProcAddress("eglCreatePbufferSurface");
createContext = (PFNEGLCREATECONTEXTPROC) eglGetProcAddress("eglCreateContext");
makeCurrent = (PFNEGLMAKECURRENTPROC) eglGetProcAddress("eglMakeCurrent");
if (!getError || !getDisplay || !initialize || !bindAPI || !chooseConfig || !createWindowSurface || !createContext || !makeCurrent)
return GL_TRUE;
pBuffer = 0;
display = EGL_NO_DISPLAY;
if (queryDevices && getPlatformDisplay)
{
queryDevices(1, devices, &numDevices);
if (numDevices==1)
{
/* Nvidia EGL doesn't need X11 for p-buffer surface */
display = getPlatformDisplay(EGL_PLATFORM_DEVICE_EXT, devices[0], 0);
configAttribs[1] = EGL_PBUFFER_BIT;
pBuffer = 1;
}
}
if (display==EGL_NO_DISPLAY)
{
/* Fall-back to X11 surface, works on Mesa */
display = getDisplay(EGL_DEFAULT_DISPLAY);
}
if (display == EGL_NO_DISPLAY)
return GL_TRUE;
eglewInit(display);
if (bindAPI(EGL_OPENGL_API) != EGL_TRUE)
return GL_TRUE;
if (chooseConfig(display, configAttribs, &config, 1, &numConfig) != EGL_TRUE || (numConfig != 1))
return GL_TRUE;
ctx = createContext(display, config, EGL_NO_CONTEXT, pBuffer ? contextAttribs : NULL);
if (NULL == ctx)
return GL_TRUE;
surface = EGL_NO_SURFACE;
/* Create a p-buffer surface if possible */
if (pBuffer && createPbufferSurface)
{
surface = createPbufferSurface(display, config, pBufferAttribs);
}
/* Create a generic surface without a native window, if necessary */
if (surface==EGL_NO_SURFACE)
{
surface = createWindowSurface(display, config, (EGLNativeWindowType) NULL, NULL);
}
#if 0
if (surface == EGL_NO_SURFACE)
return GL_TRUE;
#endif
if (makeCurrent(display, surface, surface, ctx) != EGL_TRUE)
return GL_TRUE;
return GL_FALSE;
}
void glewDestroyContext ()
{
if (NULL != ctx) eglDestroyContext(display, ctx);
}
#elif defined(GLEW_OSMESA)
OSMesaContext ctx;
static const GLint osmFormat = GL_UNSIGNED_BYTE;
static const GLint osmWidth = 640;
static const GLint osmHeight = 480;
static GLubyte *osmPixels = NULL;
GLboolean glewCreateContext (struct createParams *params)
{
ctx = OSMesaCreateContext(OSMESA_RGBA, NULL);
if (NULL == ctx) return GL_TRUE;
if (NULL == osmPixels)
{
osmPixels = (GLubyte *) calloc(osmWidth*osmHeight*4, 1);
}
if (!OSMesaMakeCurrent(ctx, osmPixels, GL_UNSIGNED_BYTE, osmWidth, osmHeight))
{
return GL_TRUE;
}
return GL_FALSE;
}
void glewDestroyContext ()
{
if (NULL != ctx) OSMesaDestroyContext(ctx);
}
#elif defined(_WIN32)
HWND wnd = NULL;
HDC dc = NULL;
HGLRC rc = NULL;
GLboolean glewCreateContext (struct createParams* params)
{
WNDCLASS wc;
PIXELFORMATDESCRIPTOR pfd;
/* register window class */
ZeroMemory(&wc, sizeof(WNDCLASS));
wc.hInstance = GetModuleHandle(NULL);
wc.lpfnWndProc = DefWindowProc;
wc.lpszClassName = "GLEW";
if (0 == RegisterClass(&wc)) return GL_TRUE;
/* create window */
wnd = CreateWindow("GLEW", "GLEW", 0, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, NULL, NULL, GetModuleHandle(NULL), NULL);
if (NULL == wnd) return GL_TRUE;
/* get the device context */
dc = GetDC(wnd);
if (NULL == dc) return GL_TRUE;
/* find pixel format */
ZeroMemory(&pfd, sizeof(PIXELFORMATDESCRIPTOR));
if (params->pixelformat == -1) /* find default */
{
pfd.nSize = sizeof(PIXELFORMATDESCRIPTOR);
pfd.nVersion = 1;
pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL;
params->pixelformat = ChoosePixelFormat(dc, &pfd);
if (params->pixelformat == 0) return GL_TRUE;
}
/* set the pixel format for the dc */
if (FALSE == SetPixelFormat(dc, params->pixelformat, &pfd)) return GL_TRUE;
/* create rendering context */
rc = wglCreateContext(dc);
if (NULL == rc) return GL_TRUE;
if (FALSE == wglMakeCurrent(dc, rc)) return GL_TRUE;
if (params->major || params->profile || params->flags)
{
HGLRC oldRC = rc;
int contextAttrs[20];
int i;
wglewInit();
/* Intel HD 3000 has WGL_ARB_create_context, but not WGL_ARB_create_context_profile */
if (!wglewGetExtension("WGL_ARB_create_context"))
return GL_TRUE;
i = 0;
if (params->major)
{
contextAttrs[i++] = WGL_CONTEXT_MAJOR_VERSION_ARB;
contextAttrs[i++] = params->major;
contextAttrs[i++] = WGL_CONTEXT_MINOR_VERSION_ARB;
contextAttrs[i++] = params->minor;
}
if (params->profile)
{
contextAttrs[i++] = WGL_CONTEXT_PROFILE_MASK_ARB;
contextAttrs[i++] = params->profile;
}
if (params->flags)
{
contextAttrs[i++] = WGL_CONTEXT_FLAGS_ARB;
contextAttrs[i++] = params->flags;
}
contextAttrs[i++] = 0;
rc = wglCreateContextAttribsARB(dc, 0, contextAttrs);
if (NULL == rc) return GL_TRUE;
if (!wglMakeCurrent(dc, rc)) return GL_TRUE;
wglDeleteContext(oldRC);
}
return GL_FALSE;
}
void glewDestroyContext ()
{
if (NULL != rc) wglMakeCurrent(NULL, NULL);
if (NULL != rc) wglDeleteContext(rc);
if (NULL != wnd && NULL != dc) ReleaseDC(wnd, dc);
if (NULL != wnd) DestroyWindow(wnd);
UnregisterClass("GLEW", GetModuleHandle(NULL));
}
/* ------------------------------------------------------------------------ */
#elif defined(__APPLE__) && !defined(GLEW_APPLE_GLX)
#include <OpenGL/OpenGL.h>
#include <OpenGL/CGLTypes.h>
CGLContextObj ctx, octx;
GLboolean glewCreateContext (struct createParams *params)
{
CGLPixelFormatAttribute contextAttrs[20];
int i;
CGLPixelFormatObj pf;
GLint npix;
CGLError error;
i = 0;
contextAttrs[i++] = kCGLPFAAccelerated; /* No software rendering */
/* MAC_OS_X_VERSION_10_7 == 1070 */
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
if (params->profile & GL_CONTEXT_CORE_PROFILE_BIT)
{
if ((params->major==3 && params->minor>=2) || params->major>3)
{
contextAttrs[i++] = kCGLPFAOpenGLProfile; /* OSX 10.7 Lion onwards */
contextAttrs[i++] = (CGLPixelFormatAttribute) kCGLOGLPVersion_3_2_Core; /* 3.2 Core Context */
}
}
#endif
contextAttrs[i++] = 0;
error = CGLChoosePixelFormat(contextAttrs, &pf, &npix);
if (error) return GL_TRUE;
error = CGLCreateContext(pf, NULL, &ctx);
if (error) return GL_TRUE;
CGLReleasePixelFormat(pf);
octx = CGLGetCurrentContext();
error = CGLSetCurrentContext(ctx);
if (error) return GL_TRUE;
/* Needed for Regal on the Mac */
#if defined(GLEW_REGAL) && defined(__APPLE__)
RegalMakeCurrent(ctx);
#endif
return GL_FALSE;
}
void glewDestroyContext ()
{
CGLSetCurrentContext(octx);
CGLReleaseContext(ctx);
}
/* ------------------------------------------------------------------------ */
#elif defined(__HAIKU__)
GLboolean glewCreateContext (struct createParams *params)
{
/* TODO: Haiku: We need to call C++ code here */
return GL_FALSE;
}
void glewDestroyContext ()
{
/* TODO: Haiku: We need to call C++ code here */
}
/* ------------------------------------------------------------------------ */
#else /* __UNIX || (__APPLE__ && GLEW_APPLE_GLX) */
Display* dpy = NULL;
XVisualInfo* vi = NULL;
XVisualInfo* vis = NULL;
GLXContext ctx = NULL;
Window wnd = 0;
Colormap cmap = 0;
GLboolean glewCreateContext (struct createParams *params)
{
int attrib[] = { GLX_RGBA, GLX_DOUBLEBUFFER, None };
int erb, evb;
XSetWindowAttributes swa;
/* open display */
dpy = XOpenDisplay(params->display);
if (NULL == dpy) return GL_TRUE;
/* query for glx */
if (!glXQueryExtension(dpy, &erb, &evb)) return GL_TRUE;
/* choose visual */
if (params->visual == -1)
{
vi = glXChooseVisual(dpy, DefaultScreen(dpy), attrib);
if (NULL == vi) return GL_TRUE;
params->visual = (int)XVisualIDFromVisual(vi->visual);
}
else
{
int n_vis, i;
vis = XGetVisualInfo(dpy, 0, NULL, &n_vis);
for (i=0; i<n_vis; i++)
{
if ((int)XVisualIDFromVisual(vis[i].visual) == params->visual)
vi = &vis[i];
}
if (vi == NULL) return GL_TRUE;
}
/* create context */
ctx = glXCreateContext(dpy, vi, None, True);
if (NULL == ctx) return GL_TRUE;
/* create window */
/*wnd = XCreateSimpleWindow(dpy, RootWindow(dpy, vi->screen), 0, 0, 1, 1, 1, 0, 0);*/
cmap = XCreateColormap(dpy, RootWindow(dpy, vi->screen), vi->visual, AllocNone);
swa.border_pixel = 0;
swa.colormap = cmap;
wnd = XCreateWindow(dpy, RootWindow(dpy, vi->screen),
0, 0, 1, 1, 0, vi->depth, InputOutput, vi->visual,
CWBorderPixel | CWColormap, &swa);
/* make context current */
if (!glXMakeCurrent(dpy, wnd, ctx)) return GL_TRUE;
if (params->major || params->profile || params->flags)
{
GLXContext oldCtx = ctx;
GLXFBConfig *FBConfigs;
int FBConfigAttrs[] = { GLX_FBCONFIG_ID, 0, None };
int contextAttrs[20];
int nelems, i;
glxewInit();
if (!glxewGetExtension("GLX_ARB_create_context"))
return GL_TRUE;
if (glXQueryContext(dpy, oldCtx, GLX_FBCONFIG_ID, &FBConfigAttrs[1]))
return GL_TRUE;
FBConfigs = glXChooseFBConfig(dpy, vi->screen, FBConfigAttrs, &nelems);
if (nelems < 1)
return GL_TRUE;
i = 0;
if (params->major)
{
contextAttrs[i++] = GLX_CONTEXT_MAJOR_VERSION_ARB;
contextAttrs[i++] = params->major;
contextAttrs[i++] = GLX_CONTEXT_MINOR_VERSION_ARB;
contextAttrs[i++] = params->minor;
}
if (params->profile)
{
contextAttrs[i++] = GLX_CONTEXT_PROFILE_MASK_ARB;
contextAttrs[i++] = params->profile;
}
if (params->flags)
{
contextAttrs[i++] = GLX_CONTEXT_FLAGS_ARB;
contextAttrs[i++] = params->flags;
}
contextAttrs[i++] = None;
ctx = glXCreateContextAttribsARB(dpy, *FBConfigs, NULL, True, contextAttrs);
if (NULL == ctx) return GL_TRUE;
if (!glXMakeCurrent(dpy, wnd, ctx)) return GL_TRUE;
glXDestroyContext(dpy, oldCtx);
XFree(FBConfigs);
}
return GL_FALSE;
}
void glewDestroyContext ()
{
if (NULL != dpy && NULL != ctx) glXDestroyContext(dpy, ctx);
if (NULL != dpy && 0 != wnd) XDestroyWindow(dpy, wnd);
if (NULL != dpy && 0 != cmap) XFreeColormap(dpy, cmap);
if (NULL != vis)
XFree(vis);
else if (NULL != vi)
XFree(vi);
if (NULL != dpy) XCloseDisplay(dpy);
}
#endif /* __UNIX || (__APPLE__ && GLEW_APPLE_GLX) */

View File

@@ -0,0 +1,8 @@
}
/* ------------------------------------------------------------------------ */
#if defined(_WIN32) && !defined(GLEW_EGL) && !defined(GLEW_OSMESA)
static void wglewInfo ()
{

View File

@@ -0,0 +1,106 @@
#ifndef __glxew_h__
#define __glxew_h__
#define __GLXEW_H__
#ifdef __glxext_h_
#error glxext.h included before glxew.h
#endif
#if defined(GLX_H) || defined(__GLX_glx_h__) || defined(__glx_h__)
#error glx.h included before glxew.h
#endif
#define __glxext_h_
#define GLX_H
#define __GLX_glx_h__
#define __glx_h__
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xmd.h>
#include <GL/glew.h>
#ifdef __cplusplus
extern "C" {
#endif
/* ---------------------------- GLX_VERSION_1_0 --------------------------- */
#ifndef GLX_VERSION_1_0
#define GLX_VERSION_1_0 1
#define GLX_USE_GL 1
#define GLX_BUFFER_SIZE 2
#define GLX_LEVEL 3
#define GLX_RGBA 4
#define GLX_DOUBLEBUFFER 5
#define GLX_STEREO 6
#define GLX_AUX_BUFFERS 7
#define GLX_RED_SIZE 8
#define GLX_GREEN_SIZE 9
#define GLX_BLUE_SIZE 10
#define GLX_ALPHA_SIZE 11
#define GLX_DEPTH_SIZE 12
#define GLX_STENCIL_SIZE 13
#define GLX_ACCUM_RED_SIZE 14
#define GLX_ACCUM_GREEN_SIZE 15
#define GLX_ACCUM_BLUE_SIZE 16
#define GLX_ACCUM_ALPHA_SIZE 17
#define GLX_BAD_SCREEN 1
#define GLX_BAD_ATTRIBUTE 2
#define GLX_NO_EXTENSION 3
#define GLX_BAD_VISUAL 4
#define GLX_BAD_CONTEXT 5
#define GLX_BAD_VALUE 6
#define GLX_BAD_ENUM 7
typedef XID GLXDrawable;
typedef XID GLXPixmap;
#ifdef __sun
typedef struct __glXContextRec *GLXContext;
#else
typedef struct __GLXcontextRec *GLXContext;
#endif
typedef unsigned int GLXVideoDeviceNV;
extern Bool glXQueryExtension (Display *dpy, int *errorBase, int *eventBase);
extern Bool glXQueryVersion (Display *dpy, int *major, int *minor);
extern int glXGetConfig (Display *dpy, XVisualInfo *vis, int attrib, int *value);
extern XVisualInfo* glXChooseVisual (Display *dpy, int screen, int *attribList);
extern GLXPixmap glXCreateGLXPixmap (Display *dpy, XVisualInfo *vis, Pixmap pixmap);
extern void glXDestroyGLXPixmap (Display *dpy, GLXPixmap pix);
extern GLXContext glXCreateContext (Display *dpy, XVisualInfo *vis, GLXContext shareList, Bool direct);
extern void glXDestroyContext (Display *dpy, GLXContext ctx);
extern Bool glXIsDirect (Display *dpy, GLXContext ctx);
extern void glXCopyContext (Display *dpy, GLXContext src, GLXContext dst, GLulong mask);
extern Bool glXMakeCurrent (Display *dpy, GLXDrawable drawable, GLXContext ctx);
extern GLXContext glXGetCurrentContext (void);
extern GLXDrawable glXGetCurrentDrawable (void);
extern void glXWaitGL (void);
extern void glXWaitX (void);
extern void glXSwapBuffers (Display *dpy, GLXDrawable drawable);
extern void glXUseXFont (Font font, int first, int count, int listBase);
#define GLXEW_VERSION_1_0 GLXEW_GET_VAR(__GLXEW_VERSION_1_0)
#endif /* GLX_VERSION_1_0 */
/* ---------------------------- GLX_VERSION_1_1 --------------------------- */
#ifndef GLX_VERSION_1_1
#define GLX_VERSION_1_1
#define GLX_VENDOR 0x1
#define GLX_VERSION 0x2
#define GLX_EXTENSIONS 0x3
extern const char* glXQueryExtensionsString (Display *dpy, int screen);
extern const char* glXGetClientString (Display *dpy, int name);
extern const char* glXQueryServerString (Display *dpy, int screen, int name);
#define GLXEW_VERSION_1_1 GLXEW_GET_VAR(__GLXEW_VERSION_1_1)
#endif /* GLX_VERSION_1_1 */

View File

@@ -0,0 +1,4 @@
/* ------------------------------------------------------------------------- */
#define GLXEW_FUN_EXPORT GLEW_FUN_EXPORT
#define GLXEW_VAR_EXPORT GLEW_VAR_EXPORT

View File

@@ -0,0 +1,20 @@
/* ------------------------------------------------------------------------ */
GLEWAPI GLenum GLEWAPIENTRY glxewInit ();
GLEWAPI GLboolean GLEWAPIENTRY glxewIsSupported (const char *name);
#ifndef GLXEW_GET_VAR
#define GLXEW_GET_VAR(x) (*(const GLboolean*)&x)
#endif
#ifndef GLXEW_GET_FUN
#define GLXEW_GET_FUN(x) x
#endif
GLEWAPI GLboolean GLEWAPIENTRY glxewGetExtension (const char *name);
#ifdef __cplusplus
}
#endif
#endif /* __glxew_h__ */

View File

@@ -0,0 +1,98 @@
<!-- begin header.html -->
<!--
The OpenGL Extension Wrangler Library
Copyright (C) 2008-2015, Nigel Stewart <nigels[]users sourceforge net>
Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
Copyright (C) 2002, Lev Povalahev
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* The name of the author may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html/4/loose.dtd">
<html>
<head>
<title>GLEW: The OpenGL Extension Wrangler Library</title>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<link href="glew.css" type="text/css" rel="stylesheet">
</head>
<body bgcolor="#fff0d0">
<table border="0" width="100%" cellpadding="12" cellspacing="8" style="height:100%">
<tr>
<td bgcolor="#ffffff" align="left" valign="top" width="200">
<table border="0" width="100%" cellpadding="0" cellspacing="0" align="left">
<tr>
<td valign="top">
<table border="0" width="100%" cellpadding="0" cellspacing="0" align="left">
<tr><td align="center"><i>Latest Release: <a href="https://sourceforge.net/projects/glew/files/glew/2.1.0/">2.1.0</a></i></td></tr>
<tr><td align="center"><br></td></tr>
<tr><td align="center"><img src="./glew.png" alt="GLEW Logo" width="97" height="75"></td></tr>
<tr><td align="center"><br></td></tr>
<tr><td align="center">
<table border="0" cellpadding="0" cellspacing="0" align="center">
<tr><td align="center"><a href="index.html">Download</a></td></tr>
<tr><td align="center"><a href="basic.html">Usage</a></td></tr>
<tr><td align="center"><a href="build.html">Building</a></td></tr>
<tr><td align="center"><a href="install.html">Installation</a></td></tr>
<tr><td align="center"><a href="advanced.html">Source Generation</a></td></tr>
<tr><td align="center"><a href="log.html">Change Log</a></td></tr>
<tr><td align="center"><br></tr>
<tr><td align="center"><a href="https://github.com/nigels-com/glew">GitHub</a></td></tr>
<tr><td align="center"><a href="https://github.com/nigels-com/glew/issues">Issues</a></td></tr>
<tr><td align="center"><a href="https://github.com/nigels-com/glew/pulls">Pull Requests</a></td></tr>
<tr><td align="center"><a href="https://github.com/nigels-com/glew#authors">Authors</a></td></tr>
<tr><td align="center"><a href="https://github.com/nigels-com/glew#copyright-and-licensing">Licensing</a></td></tr>
<tr><td align="center"><br></tr>
<tr><td align="center"><a href="https://sourceforge.net/projects/glew">SourceForge Page</a></td></tr>
</table>
<tr><td align="center"><br></tr>
</table>
</td>
</tr>
<tr>
<td valign="bottom">
<table border="0" width="100%" cellpadding="5" cellspacing="0" align="left">
<tr><td align="center"><i>Last Update: 07-31-17</i></td></tr>
<tr><td align="center">
<a href="http://www.opengl.org"><img src="./ogl_sm.jpg" width="68" height="35" border="0" alt="OpenGL Logo"></a><br/>
<a href="https://github.com/nigels-com/glew"><img src="github.png" width="70" height="29" border="0" alt="GitHub Logo"></a><br/>
<a href="https://travis-ci.org/nigels-com/glew/builds"><img src="travis.png" width="114" height="25" border="0" alt="Travis Logo"></a><br/>
<a href="http://sourceforge.net"><img src="http://sourceforge.net/sflogo.php?group_id=67586&amp;type=1" width="88" height="31" border="0" alt="SourceForge Logo"></a>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<td bgcolor="#ffffff" align="left" valign="top">
<h1>The OpenGL Extension Wrangler Library</h1>
<!-- end header.html -->

View File

@@ -0,0 +1,23 @@
/*
** Copyright (c) 2007 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
** "Materials"), to deal in the Materials without restriction, including
** without limitation the rights to use, copy, modify, merge, publish,
** distribute, sublicense, and/or sell copies of the Materials, and to
** permit persons to whom the Materials are furnished to do so, subject to
** the following conditions:
**
** The above copyright notice and this permission notice shall be included
** in all copies or substantial portions of the Materials.
**
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/

View File

@@ -0,0 +1,24 @@
/*
* Mesa 3-D graphics library
* Version: 7.0
*
* Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

View File

@@ -0,0 +1,123 @@
#include <windows.h>
#ifdef _DEBUG
# define FILENAME "visualinfod.exe"
#else
# define FILENAME "visualinfo.exe"
#endif
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION GLEW_MAJOR, GLEW_MINOR, GLEW_MICRO, 0
PRODUCTVERSION GLEW_MAJOR, GLEW_MINOR, GLEW_MICRO, 0
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
#ifdef _DEBUG
FILEFLAGS VS_FF_DEBUG
#else
FILEFLAGS 0x0L
#endif
FILEOS VOS__WINDOWS32
FILETYPE VFT_APP
FILESUBTYPE VFT2_UNKNOWN
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "Comments",
"The OpenGL Extension Wrangler Library\r\n"
"Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>\r\n"
"Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>\r\n"
"Copyright (C) 2002, Lev Povalahev\r\n"
"All rights reserved.\r\n"
"\r\n"
"Redistribution and use in source and binary forms, with or without \r\n"
"modification, are permitted provided that the following conditions are met:\r\n"
"\r\n"
"* Redistributions of source code must retain the above copyright notice, \r\n"
" this list of conditions and the following disclaimer.\r\n"
"* Redistributions in binary form must reproduce the above copyright notice, \r\n"
" this list of conditions and the following disclaimer in the documentation \r\n"
" and/or other materials provided with the distribution.\r\n"
"* The name of the author may be used to endorse or promote products \r\n"
" derived from this software without specific prior written permission.\r\n"
"\r\n"
"THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ''AS IS'' \r\n"
"AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE \r\n"
"IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r\n"
"ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE \r\n"
"LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR \r\n"
"CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF \r\n"
"SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r\n"
"INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r\n"
"CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n"
"ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF\r\n"
"THE POSSIBILITY OF SUCH DAMAGE.\r\n"
"\r\n"
"\r\n"
"Mesa 3-D graphics library\r\n"
"\r\n"
"Version: 7.0\r\n"
"\r\n"
"Copyright (C) 1999-2007 Brian Paul All Rights Reserved.\r\n"
"\r\n"
"Permission is hereby granted, free of charge, to any person obtaining a\r\n"
"copy of this software and associated documentation files (the ''Software''),\r\n"
"to deal in the Software without restriction, including without limitation\r\n"
"the rights to use, copy, modify, merge, publish, distribute, sublicense,\r\n"
"and/or sell copies of the Software, and to permit persons to whom the\r\n"
"Software is furnished to do so, subject to the following conditions:\r\n"
"\r\n"
"The above copyright notice and this permission notice shall be included\r\n"
"in all copies or substantial portions of the Software.\r\n"
"\r\n"
"THE SOFTWARE IS PROVIDED ''AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS\r\n"
"OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n"
"FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\r\n"
"BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\r\n"
"AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r\n"
"CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n"
"\r\n"
"\r\n"
"Copyright (c) 2007 The Khronos Group Inc.\r\n"
"\r\n"
"Permission is hereby granted, free of charge, to any person obtaining a\r\n"
"copy of this software and/or associated documentation files (the\r\n"
"''Materials''), to deal in the Materials without restriction, including\r\n"
"without limitation the rights to use, copy, modify, merge, publish,\r\n"
"distribute, sublicense, and/or sell copies of the Materials, and to\r\n"
"permit persons to whom the Materials are furnished to do so, subject to\r\n"
"the following conditions:\r\n"
"\r\n"
"The above copyright notice and this permission notice shall be included\r\n"
"in all copies or substantial portions of the Materials.\r\n"
"\r\n"
"THE MATERIALS ARE PROVIDED ''AS IS'', WITHOUT WARRANTY OF ANY KIND,\r\n"
"EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\n"
"MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\r\n"
"IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\r\n"
"CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\r\n"
"TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\r\n"
"MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.\0"
VALUE "CompanyName", "\0"
VALUE "FileDescription", "Utility for listing pixelformat capabilities\0"
VALUE "FileVersion", "GLEW_MAJOR,GLEW_MINOR,GLEW_MICRO,0\0"
VALUE "InternalName", "visualinfo\0"
VALUE "LegalCopyright", "<22> 2002-2008 Milan Ikits & Marcelo Magallon\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", FILENAME "\0"
VALUE "PrivateBuild", "\0"
VALUE "ProductName", "The OpenGL Extension Wrangler Library\0"
VALUE "ProductVersion", "GLEW_MAJOR,GLEW_MINOR,GLEW_MICRO,0\0"
VALUE "SpecialBuild", "\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END

View File

@@ -0,0 +1,36 @@
#ifndef __wglew_h__
#define __wglew_h__
#define __WGLEW_H__
#ifdef __wglext_h_
#error wglext.h included before wglew.h
#endif
#define __wglext_h_
#if !defined(WINAPI)
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN 1
# endif
#include <windows.h>
# undef WIN32_LEAN_AND_MEAN
#endif
/*
* GLEW_STATIC needs to be set when using the static version.
* GLEW_BUILD is set when building the DLL version.
*/
#ifdef GLEW_STATIC
# define GLEWAPI extern
#else
# ifdef GLEW_BUILD
# define GLEWAPI extern __declspec(dllexport)
# else
# define GLEWAPI extern __declspec(dllimport)
# endif
#endif
#ifdef __cplusplus
extern "C" {
#endif

View File

@@ -0,0 +1,4 @@
/* ------------------------------------------------------------------------- */
#define WGLEW_FUN_EXPORT GLEW_FUN_EXPORT
#define WGLEW_VAR_EXPORT GLEW_VAR_EXPORT

View File

@@ -0,0 +1,22 @@
/* ------------------------------------------------------------------------- */
GLEWAPI GLenum GLEWAPIENTRY wglewInit ();
GLEWAPI GLboolean GLEWAPIENTRY wglewIsSupported (const char *name);
#ifndef WGLEW_GET_VAR
#define WGLEW_GET_VAR(x) (*(const GLboolean*)&x)
#endif
#ifndef WGLEW_GET_FUN
#define WGLEW_GET_FUN(x) x
#endif
GLEWAPI GLboolean GLEWAPIENTRY wglewGetExtension (const char *name);
#ifdef __cplusplus
}
#endif
#undef GLEWAPI
#endif /* __wglew_h__ */