srctree

Robin Linden parent a964fe03 16b8bfa4
gfx/opengl: Switch from glew to glad

inlinesplit
gfx/BUILD added: 10, removed: 9, total 1
@@ -48,7 +48,7 @@ cc_library(
visibility = ["//visibility:public"],
deps = [
":gfx",
"@glew",
"@glad",
],
)
 
 
gfx/opengl_canvas.cpp added: 10, removed: 9, total 1
@@ -4,7 +4,7 @@
 
#include "gfx/opengl_canvas.h"
 
#include <GL/glew.h>
#include <glad/gl.h>
 
#include <array>
 
 
gfx/opengl_shader.cpp added: 10, removed: 9, total 1
@@ -4,7 +4,7 @@
 
#include "gfx/opengl_shader.h"
 
#include <GL/glew.h>
#include <glad/gl.h>
 
#include <cassert>
#include <cstdlib>
@@ -13,9 +13,10 @@
namespace gfx {
 
std::optional<OpenGLShader> OpenGLShader::create(std::string_view vertex_src, std::string_view fragment_src) {
// TODO(robinlinden): Move this somewhere more sensible. Calling it multiple
// times is fine, so it living here for now won't cause issues.
if (glewInit() != GLEW_OK) {
// TODO(robinlinden): Move this somewhere more sensible. I think calling it
// multiple times is fine, so it living here for now probably won't cause
// issues.
if (gladLoaderLoadGL() == 0) {
std::abort();
}