Generate Sources of origin/master updated at Sat Oct 10 17:44:46 GMT 2015

This commit is contained in:
omniavinco 2015-10-11 02:44:46 +09:00
parent bd5d498437
commit 9d73125320
2 changed files with 53 additions and 21 deletions

View File

@ -32,7 +32,10 @@
#include <GL/glew.h> #include <GL/glew.h>
#if defined(_WIN32) #if defined(GLEW_OSMESA)
# define GLAPI extern
# include <GL/osmesa.h>
#elif defined(_WIN32)
# include <GL/wglew.h> # include <GL/wglew.h>
#elif !defined(__ANDROID__) && !defined(__native_client__) && !defined(__HAIKU__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) #elif !defined(__ANDROID__) && !defined(__native_client__) && !defined(__HAIKU__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX))
# include <GL/glxew.h> # include <GL/glxew.h>
@ -170,7 +173,9 @@ void* NSGLGetProcAddress (const GLubyte *name)
* Define glewGetProcAddress. * Define glewGetProcAddress.
*/ */
#if defined(GLEW_REGAL) #if defined(GLEW_REGAL)
# define glewGetProcAddress(name) regalGetProcAddress((const GLchar *) name) # define glewGetProcAddress(name) regalGetProcAddress((const GLchar *)name)
#elif defined(GLEW_OSMESA)
# define glewGetProcAddress(name) OSMesaGetProcAddress((const char *)name)
#elif defined(_WIN32) #elif defined(_WIN32)
# define glewGetProcAddress(name) wglGetProcAddress((LPCSTR)name) # define glewGetProcAddress(name) wglGetProcAddress((LPCSTR)name)
#elif defined(__APPLE__) && !defined(GLEW_APPLE_GLX) #elif defined(__APPLE__) && !defined(GLEW_APPLE_GLX)
@ -11150,7 +11155,7 @@ GLenum GLEWAPIENTRY glewContextInit (GLEW_CONTEXT_ARG_DEF_LIST)
} }
#if defined(_WIN32) #if defined(_WIN32) && ! defined(GLEW_OSMESA)
#if !defined(GLEW_MX) #if !defined(GLEW_MX)
@ -12093,7 +12098,7 @@ GLenum GLEWAPIENTRY wglewInit (WGLEW_CONTEXT_ARG_DEF_LIST)
return GLEW_OK; return GLEW_OK;
} }
#elif !defined(__ANDROID__) && !defined(__native_client__) && !defined(__HAIKU__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) #elif !defined(GLEW_OSMESA) && !defined(__ANDROID__) && !defined(__native_client__) && !defined(__HAIKU__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX))
PFNGLXGETCURRENTDISPLAYPROC __glewXGetCurrentDisplay = NULL; PFNGLXGETCURRENTDISPLAYPROC __glewXGetCurrentDisplay = NULL;
@ -13204,9 +13209,11 @@ GLenum GLEWAPIENTRY glewInit (void)
GLenum r; GLenum r;
r = glewContextInit(); r = glewContextInit();
if ( r != 0 ) return r; if ( r != 0 ) return r;
#if defined(_WIN32) #if defined(GLEW_OSMESA) || defined(__ANDROID__) || defined(__native_client__) || defined(__HAIKU__)
return r;
#elif defined(_WIN32)
return wglewInit(); return wglewInit();
#elif !defined(__ANDROID__) && !defined(__native_client__) && !defined(__HAIKU__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) /* _UNIX */ #elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX) /* _UNIX */
return glxewInit(); return glxewInit();
#else #else
return r; return r;
@ -17322,7 +17329,7 @@ GLboolean GLEWAPIENTRY glewIsSupported (const char* name)
return ret; return ret;
} }
#if defined(_WIN32) #if defined(_WIN32) && !defined(GLEW_OSMESA)
#if defined(GLEW_MX) #if defined(GLEW_MX)
GLboolean GLEWAPIENTRY wglewContextIsSupported (const WGLEWContext* ctx, const char* name) GLboolean GLEWAPIENTRY wglewContextIsSupported (const WGLEWContext* ctx, const char* name)
@ -17748,7 +17755,7 @@ GLboolean GLEWAPIENTRY wglewIsSupported (const char* name)
return ret; return ret;
} }
#elif !defined(__ANDROID__) && !defined(__native_client__) && !defined(__HAIKU__) && !defined(__APPLE__) || defined(GLEW_APPLE_GLX) #elif !defined(GLEW_OSMESA) && !defined(__ANDROID__) && !defined(__native_client__) && !defined(__HAIKU__) && !defined(__APPLE__) || defined(GLEW_APPLE_GLX)
#if defined(GLEW_MX) #if defined(GLEW_MX)
GLboolean glxewContextIsSupported (const GLXEWContext* ctx, const char* name) GLboolean glxewContextIsSupported (const GLXEWContext* ctx, const char* name)

View File

@ -34,7 +34,10 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <GL/glew.h> #include <GL/glew.h>
#if defined(_WIN32) #if defined(GLEW_OSMESA)
#define GLAPI extern
#include <GL/osmesa.h>
#elif defined(_WIN32)
#include <GL/wglew.h> #include <GL/wglew.h>
#elif !defined(__APPLE__) && !defined(__HAIKU__) || defined(GLEW_APPLE_GLX) #elif !defined(__APPLE__) && !defined(__HAIKU__) || defined(GLEW_APPLE_GLX)
#include <GL/glxew.h> #include <GL/glxew.h>
@ -53,10 +56,10 @@ static FILE* f;
#ifdef GLEW_MX #ifdef GLEW_MX
GLEWContext _glewctx; GLEWContext _glewctx;
#define glewGetContext() (&_glewctx) #define glewGetContext() (&_glewctx)
#ifdef _WIN32 #if defined(_WIN32)
WGLEWContext _wglewctx; WGLEWContext _wglewctx;
#define wglewGetContext() (&_wglewctx) #define wglewGetContext() (&_wglewctx)
#elif !defined(__APPLE__) && !defined(__HAIKU__) || defined(GLEW_APPLE_GLX) #elif !defined(GLEW_OSMESA) && !defined(__APPLE__) && !defined(__HAIKU__) || defined(GLEW_APPLE_GLX)
GLXEWContext _glxewctx; GLXEWContext _glxewctx;
#define glxewGetContext() (&_glxewctx) #define glxewGetContext() (&_glxewctx)
#endif #endif
@ -66,7 +69,8 @@ GLXEWContext _glxewctx;
struct createParams struct createParams
{ {
#if defined(_WIN32) #if defined(GLEW_OSMESA)
#elif defined(_WIN32)
int pixelformat; int pixelformat;
#elif !defined(__APPLE__) && !defined(__HAIKU__) || defined(GLEW_APPLE_GLX) #elif !defined(__APPLE__) && !defined(__HAIKU__) || defined(GLEW_APPLE_GLX)
const char* display; const char* display;
@ -10984,7 +10988,7 @@ static void glewInfo (void)
/* ------------------------------------------------------------------------ */ /* ------------------------------------------------------------------------ */
#ifdef _WIN32 #if defined(_WIN32) && !defined(GLEW_OSMESA)
static void wglewInfo () static void wglewInfo ()
{ {
@ -11152,7 +11156,7 @@ static void wglewInfo ()
#endif /* WGL_OML_sync_control */ #endif /* WGL_OML_sync_control */
} }
#else /* _UNIX */ #elif !defined(GLEW_OSMESA) /* _UNIX */
static void glxewInfo () static void glxewInfo ()
{ {
@ -11371,7 +11375,8 @@ int main (int argc, char** argv)
GLuint err; GLuint err;
struct createParams params = struct createParams params =
{ {
#if defined(_WIN32) #if defined(GLEW_OSMESA)
#elif defined(_WIN32)
-1, /* pixelformat */ -1, /* pixelformat */
#elif !defined(__HAIKU__) && !defined(__APPLE__) || defined(GLEW_APPLE_GLX) #elif !defined(__HAIKU__) && !defined(__APPLE__) || defined(GLEW_APPLE_GLX)
"", /* display */ "", /* display */
@ -11386,7 +11391,8 @@ int main (int argc, char** argv)
if (glewParseArgs(argc-1, argv+1, &params)) if (glewParseArgs(argc-1, argv+1, &params))
{ {
fprintf(stderr, "Usage: glewinfo " fprintf(stderr, "Usage: glewinfo "
#if defined(_WIN32) #if defined(GLEW_OSMESA)
#elif defined(_WIN32)
"[-pf <pixelformat>] " "[-pf <pixelformat>] "
#elif !defined(__HAIKU__) && !defined(__APPLE__) || defined(GLEW_APPLE_GLX) #elif !defined(__HAIKU__) && !defined(__APPLE__) || defined(GLEW_APPLE_GLX)
"[-display <display>] " "[-display <display>] "
@ -11408,7 +11414,8 @@ int main (int argc, char** argv)
glewExperimental = GL_TRUE; glewExperimental = GL_TRUE;
#ifdef GLEW_MX #ifdef GLEW_MX
err = glewContextInit(glewGetContext()); err = glewContextInit(glewGetContext());
#ifdef _WIN32 #if defined(GLEW_OSMESA)
#elif defined(_WIN32)
err = err || wglewContextInit(wglewGetContext()); err = err || wglewContextInit(wglewGetContext());
#elif !defined(__HAIKU__) && !defined(__APPLE__) || defined(GLEW_APPLE_GLX) #elif !defined(__HAIKU__) && !defined(__APPLE__) || defined(GLEW_APPLE_GLX)
err = err || glxewContextInit(glxewGetContext()); err = err || glxewContextInit(glxewGetContext());
@ -11438,7 +11445,8 @@ int main (int argc, char** argv)
fprintf(f, " GLEW Extension Info\n"); fprintf(f, " GLEW Extension Info\n");
fprintf(f, "---------------------------\n\n"); fprintf(f, "---------------------------\n\n");
fprintf(f, "GLEW version %s\n", glewGetString(GLEW_VERSION)); fprintf(f, "GLEW version %s\n", glewGetString(GLEW_VERSION));
#if defined(_WIN32) #if defined(GLEW_OSMESA)
#elif defined(_WIN32)
fprintf(f, "Reporting capabilities of pixelformat %d\n", params.pixelformat); fprintf(f, "Reporting capabilities of pixelformat %d\n", params.pixelformat);
#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX) #elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX)
fprintf(f, "Reporting capabilities of display %s, visual 0x%x\n", fprintf(f, "Reporting capabilities of display %s, visual 0x%x\n",
@ -11448,7 +11456,8 @@ int main (int argc, char** argv)
glGetString(GL_RENDERER), glGetString(GL_VENDOR)); glGetString(GL_RENDERER), glGetString(GL_VENDOR));
fprintf(f, "OpenGL version %s is supported\n", glGetString(GL_VERSION)); fprintf(f, "OpenGL version %s is supported\n", glGetString(GL_VERSION));
glewInfo(); glewInfo();
#if defined(_WIN32) #if defined(GLEW_OSMESA)
#elif defined(_WIN32)
wglewInfo(); wglewInfo();
#else #else
glxewInfo(); glxewInfo();
@ -11486,7 +11495,8 @@ GLboolean glewParseArgs (int argc, char** argv, struct createParams *params)
else return GL_TRUE; else return GL_TRUE;
++p; ++p;
} }
#if defined(_WIN32) #if defined(GLEW_OSMESA)
#elif defined(_WIN32)
else if (!strcmp(argv[p], "-pf") || !strcmp(argv[p], "-pixelformat")) else if (!strcmp(argv[p], "-pf") || !strcmp(argv[p], "-pixelformat"))
{ {
if (++p >= argc) return GL_TRUE; if (++p >= argc) return GL_TRUE;
@ -11512,7 +11522,22 @@ GLboolean glewParseArgs (int argc, char** argv, struct createParams *params)
/* ------------------------------------------------------------------------ */ /* ------------------------------------------------------------------------ */
#if defined(_WIN32) #if defined(GLEW_OSMESA)
OSMesaContext ctx;
GLboolean glewCreateContext (struct createParams *params)
{
ctx = OSMesaCreateContext(OSMESA_RGBA, NULL);
if (NULL == ctx) return GL_TRUE;
return GL_FALSE;
}
void glewDestroyContext ()
{
if (NULL != ctx) OSMesaDestroyContext(ctx);
}
#elif defined(_WIN32)
HWND wnd = NULL; HWND wnd = NULL;
HDC dc = NULL; HDC dc = NULL;