diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2022-03-10 15:05:26 +0100 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2022-03-10 15:05:26 +0100 |
| commit | 9d869d73c1ca8f6c884f528a3ad4f623f25dffb1 (patch) | |
| tree | eac9ea00fe50b10b054519a9f9775734a0a5b9b2 /documentation/src/opengl.dox | |
| parent | 9e4c7aa77cc9e68afe1d6865662410664eed02f7 (diff) | |
Begin documenting the Wayland platform, new in FLTK version 1.4
Diffstat (limited to 'documentation/src/opengl.dox')
| -rw-r--r-- | documentation/src/opengl.dox | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/documentation/src/opengl.dox b/documentation/src/opengl.dox index 668e26ef9..c80d4fd85 100644 --- a/documentation/src/opengl.dox +++ b/documentation/src/opengl.dox @@ -614,6 +614,27 @@ glewExperimental = GL_TRUE; \endcode before the glewInit() call. +\par Testing for success of the glewInit() call +Testing whether the glewInit() call is successful is to be done as follows: +\code +#include <FL/platform.H> // defines FLTK_USE_WAYLAND under the Wayland platform +#include <FL/Fl.H> // for Fl::warning() +#ifndef __APPLE__ +# if defined(_WIN32) +# define GLEW_STATIC 1 +# endif +# include <GL/glew.h> + + GLenum err = glewInit(); // defines pters to functions of OpenGL V 1.2 and above +# ifdef FLTK_USE_WAYLAND + // glewInit returns GLEW_ERROR_NO_GLX_DISPLAY with Wayland + if (err == GLEW_ERROR_NO_GLX_DISPLAY) err = GLEW_OK; +# endif + if (err != GLEW_OK) Fl::warning("glewInit() failed returning %u", err); +#endif // ! __APPLE__ +\endcode + + \par Changes in the build process Link with libGLEW.so (on Unix/Linux), libglew32.a (with MinGW) or glew32.lib (with MS Visual Studio); no change is needed on the Mac OS platform. |
