allow custom opengl loader

This commit is contained in:
2022-07-14 18:04:13 +02:00
parent 85eb9bbc32
commit 66376eaeda
4 changed files with 96 additions and 20 deletions

View File

@@ -5,9 +5,6 @@
* Author: simon
*/
#ifndef ANDROID
#include <glbinding/Binding.h>
#endif
#include "render/Renderer.h"
#include "render/GL.h"
#include <stdio.h>
@@ -43,8 +40,16 @@ void Renderer::InitShaders() {
}
bool Renderer::Init() {
#ifndef ANDROID
glbinding::Binding::initialize();
#if __has_include(<glbinding/glbinding.h>)
glbinding::initialize();
#elif __has_include(<GL/glew.h>)
glewInit();
#elif __has_include(<glad/glad.h>)
gladLoadGL();
#elif __has_include(<GL/gl3w.h>)
gl3wInit();
#elif __has_include(<glbinding/Binding.h>)
glbinding::Binding::initialize();
#endif
glEnable(GL_TEXTURE_2D);
glEnable(GL_BLEND);