mirror of
https://github.com/Perlmint/glew-cmake.git
synced 2024-11-27 00:51:55 +00:00
Generate Sources of origin/master updated at Sat Oct 10 17:44:46 GMT 2015
This commit is contained in:
parent
bd5d498437
commit
9d73125320
23
src/glew.c
23
src/glew.c
@ -32,7 +32,10 @@
|
||||
|
||||
#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>
|
||||
#elif !defined(__ANDROID__) && !defined(__native_client__) && !defined(__HAIKU__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX))
|
||||
# include <GL/glxew.h>
|
||||
@ -170,7 +173,9 @@ void* NSGLGetProcAddress (const GLubyte *name)
|
||||
* Define glewGetProcAddress.
|
||||
*/
|
||||
#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)
|
||||
# define glewGetProcAddress(name) wglGetProcAddress((LPCSTR)name)
|
||||
#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)
|
||||
|
||||
@ -12093,7 +12098,7 @@ GLenum GLEWAPIENTRY wglewInit (WGLEW_CONTEXT_ARG_DEF_LIST)
|
||||
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;
|
||||
|
||||
@ -13204,9 +13209,11 @@ GLenum GLEWAPIENTRY glewInit (void)
|
||||
GLenum r;
|
||||
r = glewContextInit();
|
||||
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();
|
||||
#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();
|
||||
#else
|
||||
return r;
|
||||
@ -17322,7 +17329,7 @@ GLboolean GLEWAPIENTRY glewIsSupported (const char* name)
|
||||
return ret;
|
||||
}
|
||||
|
||||
#if defined(_WIN32)
|
||||
#if defined(_WIN32) && !defined(GLEW_OSMESA)
|
||||
|
||||
#if defined(GLEW_MX)
|
||||
GLboolean GLEWAPIENTRY wglewContextIsSupported (const WGLEWContext* ctx, const char* name)
|
||||
@ -17748,7 +17755,7 @@ GLboolean GLEWAPIENTRY wglewIsSupported (const char* name)
|
||||
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)
|
||||
GLboolean glxewContextIsSupported (const GLXEWContext* ctx, const char* name)
|
||||
|
@ -34,7 +34,10 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.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>
|
||||
#elif !defined(__APPLE__) && !defined(__HAIKU__) || defined(GLEW_APPLE_GLX)
|
||||
#include <GL/glxew.h>
|
||||
@ -53,10 +56,10 @@ static FILE* f;
|
||||
#ifdef GLEW_MX
|
||||
GLEWContext _glewctx;
|
||||
#define glewGetContext() (&_glewctx)
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32)
|
||||
WGLEWContext _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;
|
||||
#define glxewGetContext() (&_glxewctx)
|
||||
#endif
|
||||
@ -66,7 +69,8 @@ GLXEWContext _glxewctx;
|
||||
|
||||
struct createParams
|
||||
{
|
||||
#if defined(_WIN32)
|
||||
#if defined(GLEW_OSMESA)
|
||||
#elif defined(_WIN32)
|
||||
int pixelformat;
|
||||
#elif !defined(__APPLE__) && !defined(__HAIKU__) || defined(GLEW_APPLE_GLX)
|
||||
const char* display;
|
||||
@ -10984,7 +10988,7 @@ static void glewInfo (void)
|
||||
|
||||
/* ------------------------------------------------------------------------ */
|
||||
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32) && !defined(GLEW_OSMESA)
|
||||
|
||||
static void wglewInfo ()
|
||||
{
|
||||
@ -11152,7 +11156,7 @@ static void wglewInfo ()
|
||||
#endif /* WGL_OML_sync_control */
|
||||
}
|
||||
|
||||
#else /* _UNIX */
|
||||
#elif !defined(GLEW_OSMESA) /* _UNIX */
|
||||
|
||||
static void glxewInfo ()
|
||||
{
|
||||
@ -11371,7 +11375,8 @@ int main (int argc, char** argv)
|
||||
GLuint err;
|
||||
struct createParams params =
|
||||
{
|
||||
#if defined(_WIN32)
|
||||
#if defined(GLEW_OSMESA)
|
||||
#elif defined(_WIN32)
|
||||
-1, /* pixelformat */
|
||||
#elif !defined(__HAIKU__) && !defined(__APPLE__) || defined(GLEW_APPLE_GLX)
|
||||
"", /* display */
|
||||
@ -11386,7 +11391,8 @@ int main (int argc, char** argv)
|
||||
if (glewParseArgs(argc-1, argv+1, ¶ms))
|
||||
{
|
||||
fprintf(stderr, "Usage: glewinfo "
|
||||
#if defined(_WIN32)
|
||||
#if defined(GLEW_OSMESA)
|
||||
#elif defined(_WIN32)
|
||||
"[-pf <pixelformat>] "
|
||||
#elif !defined(__HAIKU__) && !defined(__APPLE__) || defined(GLEW_APPLE_GLX)
|
||||
"[-display <display>] "
|
||||
@ -11408,7 +11414,8 @@ int main (int argc, char** argv)
|
||||
glewExperimental = GL_TRUE;
|
||||
#ifdef GLEW_MX
|
||||
err = glewContextInit(glewGetContext());
|
||||
#ifdef _WIN32
|
||||
#if defined(GLEW_OSMESA)
|
||||
#elif defined(_WIN32)
|
||||
err = err || wglewContextInit(wglewGetContext());
|
||||
#elif !defined(__HAIKU__) && !defined(__APPLE__) || defined(GLEW_APPLE_GLX)
|
||||
err = err || glxewContextInit(glxewGetContext());
|
||||
@ -11438,7 +11445,8 @@ int main (int argc, char** argv)
|
||||
fprintf(f, " GLEW Extension Info\n");
|
||||
fprintf(f, "---------------------------\n\n");
|
||||
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);
|
||||
#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX)
|
||||
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));
|
||||
fprintf(f, "OpenGL version %s is supported\n", glGetString(GL_VERSION));
|
||||
glewInfo();
|
||||
#if defined(_WIN32)
|
||||
#if defined(GLEW_OSMESA)
|
||||
#elif defined(_WIN32)
|
||||
wglewInfo();
|
||||
#else
|
||||
glxewInfo();
|
||||
@ -11486,7 +11495,8 @@ GLboolean glewParseArgs (int argc, char** argv, struct createParams *params)
|
||||
else return GL_TRUE;
|
||||
++p;
|
||||
}
|
||||
#if defined(_WIN32)
|
||||
#if defined(GLEW_OSMESA)
|
||||
#elif defined(_WIN32)
|
||||
else if (!strcmp(argv[p], "-pf") || !strcmp(argv[p], "-pixelformat"))
|
||||
{
|
||||
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;
|
||||
HDC dc = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user