GRAPHICS: Rework OpenGL detection

With GLAD it's not needed anymore to link against OpenGL libraries.
As configure knows better whether a platform supports GLAD, detection is
moved here.
To allow platforms where OpenGL should be linked at build time, the
tests are kept. Android uses them for now.
The OpenGL for Games was completely decoupled from the OpenGL for 2D
engines. This not the case anymore.
This commit is contained in:
Le Philousophe 2022-01-04 23:04:05 +01:00 committed by Paweł Kołodziejski
parent d9b4e457e8
commit a9418f8f63
2 changed files with 159 additions and 129 deletions

View file

@ -52,7 +52,13 @@
#define USE_FORCED_GLES2 0
#endif
#if USE_FORCED_GLES2
// Don't include any OpenGL stuff if we didn't enable it
#ifdef USE_OPENGL
#ifdef USE_GLAD
#include "graphics/opengl/glad.h"
#elif USE_FORCED_GLES2
#define GL_GLEXT_PROTOTYPES
#if defined(IPHONE)
@ -78,11 +84,7 @@
#define GL_MAX_SAMPLES 0x8D57
#endif
#else
#define USE_GLAD
#include "graphics/opengl/glad.h"
#endif
#endif
#endif