mirror of
https://github.com/nigels-com/glew.git
synced 2024-11-24 06:45:07 +00:00
visualinfo: EGL not supported yet, error out more clearly
Also, remove GLEW_MX support from visualinfo
This commit is contained in:
parent
715afa0ff5
commit
eca247239c
@ -4,7 +4,7 @@
|
|||||||
** Copyright (C) Nate Robins, 1997
|
** Copyright (C) Nate Robins, 1997
|
||||||
** Michael Wimmer, 1999
|
** Michael Wimmer, 1999
|
||||||
** Milan Ikits, 2002-2008
|
** Milan Ikits, 2002-2008
|
||||||
** Nigel Stewart, 2008-2019
|
** Nigel Stewart, 2008-2021
|
||||||
**
|
**
|
||||||
** visualinfo is a small utility that displays all available visuals,
|
** visualinfo is a small utility that displays all available visuals,
|
||||||
** aka. pixelformats, in an OpenGL system along with renderer version
|
** aka. pixelformats, in an OpenGL system along with renderer version
|
||||||
@ -48,18 +48,6 @@
|
|||||||
#include <GL/glxew.h>
|
#include <GL/glxew.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef GLEW_MX
|
|
||||||
GLEWContext _glewctx;
|
|
||||||
# define glewGetContext() (&_glewctx)
|
|
||||||
# ifdef _WIN32
|
|
||||||
WGLEWContext _wglewctx;
|
|
||||||
# define wglewGetContext() (&_wglewctx)
|
|
||||||
# elif !defined(__APPLE__) && !defined(__HAIKU__) || defined(GLEW_APPLE_GLX)
|
|
||||||
GLXEWContext _glxewctx;
|
|
||||||
# define glxewGetContext() (&_glxewctx)
|
|
||||||
# endif
|
|
||||||
#endif /* GLEW_MX */
|
|
||||||
|
|
||||||
typedef struct GLContextStruct
|
typedef struct GLContextStruct
|
||||||
{
|
{
|
||||||
#if defined(GLEW_OSMESA)
|
#if defined(GLEW_OSMESA)
|
||||||
@ -123,6 +111,13 @@ main (int argc, char** argv)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(GLEW_EGL)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "Error [main]: EGL not supported by visualinfo.\n");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
/* create OpenGL rendering context */
|
/* create OpenGL rendering context */
|
||||||
InitContext(&ctx);
|
InitContext(&ctx);
|
||||||
@ -136,16 +131,7 @@ main (int argc, char** argv)
|
|||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
/* initialize GLEW */
|
/* initialize GLEW */
|
||||||
glewExperimental = GL_TRUE;
|
glewExperimental = GL_TRUE;
|
||||||
#ifdef GLEW_MX
|
|
||||||
err = glewContextInit(glewGetContext());
|
|
||||||
# ifdef _WIN32
|
|
||||||
err = err || wglewContextInit(wglewGetContext());
|
|
||||||
# elif !defined(__APPLE__) && !defined(__HAIKU__) || defined(GLEW_APPLE_GLX)
|
|
||||||
err = err || glxewContextInit(glxewGetContext());
|
|
||||||
# endif
|
|
||||||
#else
|
|
||||||
err = glewInit();
|
err = glewInit();
|
||||||
#endif
|
|
||||||
if (GLEW_OK != err)
|
if (GLEW_OK != err)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Error [main]: glewInit failed: %s\n", glewGetErrorString(err));
|
fprintf(stderr, "Error [main]: glewInit failed: %s\n", glewGetErrorString(err));
|
||||||
|
Loading…
Reference in New Issue
Block a user