Skip to content

Commit eef3fcc

Browse files
committed
meson: Only use vendored glext.h if there is no system glext.h
The vendored glext.h is needed on Windows, but on Linux gl.h will already include a much newer version of glext.h, which causes a version mismatch. Wrangling OpenGL across platforms is a mess and maybe we should just use glew for this, but for now this works.
1 parent 3298ff7 commit eef3fcc

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

meson.build

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,8 @@ if not dep_gl.found()
361361
endif
362362
if host_machine.system() == 'darwin'
363363
conf.set('HAVE_OPENGL_GL_H', 1)
364+
else
365+
conf.set('HAVE_GL_GLEXT_H', cc.has_header('GL/glext.h'))
364366
endif
365367

366368
if not dep_gl.found()

src/gl_wrap.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,12 @@
2828
#include <OpenGL/glext.h>
2929
#else
3030
#include <GL/gl.h>
31+
#ifdef HAVE_GL_GLEXT_H
32+
#include <GL/glext.h>
33+
#else
3134
#include "gl/glext.h"
3235
#endif
36+
#endif
3337

3438
static const float deg2rad = 3.1415926536f / 180.f;
3539
static const float pi = 3.1415926535897932384626433832795f;

0 commit comments

Comments
 (0)