From 9d869d73c1ca8f6c884f528a3ad4f623f25dffb1 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Thu, 10 Mar 2022 15:05:26 +0100 Subject: Begin documenting the Wayland platform, new in FLTK version 1.4 --- documentation/src/opengl.dox | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'documentation/src/opengl.dox') 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 // defines FLTK_USE_WAYLAND under the Wayland platform +#include // for Fl::warning() +#ifndef __APPLE__ +# if defined(_WIN32) +# define GLEW_STATIC 1 +# endif +# include + + 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. -- cgit v1.2.3