From c80a8838a4f9b2396749519bb729bbd39ab68e9f Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sun, 10 Jul 2022 02:46:26 -0500 Subject: [PATCH] [nostalgia] Setup Glad as GL loader --- src/nostalgia/core/glfw/core.cpp | 2 +- src/nostalgia/core/glfw/gfx.cpp | 4 ++++ src/nostalgia/glutils/glutils.hpp | 8 -------- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/nostalgia/core/glfw/core.cpp b/src/nostalgia/core/glfw/core.cpp index 590c98b9..1125cd1f 100644 --- a/src/nostalgia/core/glfw/core.cpp +++ b/src/nostalgia/core/glfw/core.cpp @@ -2,9 +2,9 @@ * Copyright 2016 - 2022 Gary Talent (gary@drinkingtea.net). All rights reserved. */ +#include #include -#include #include #include #include diff --git a/src/nostalgia/core/glfw/gfx.cpp b/src/nostalgia/core/glfw/gfx.cpp index 28d20fbe..791c1d55 100644 --- a/src/nostalgia/core/glfw/gfx.cpp +++ b/src/nostalgia/core/glfw/gfx.cpp @@ -2,6 +2,7 @@ * Copyright 2016 - 2022 Gary Talent (gary@drinkingtea.net). All rights reserved. */ +#include #include #include @@ -109,6 +110,9 @@ ox::Error initGfx(Context *ctx) noexcept { glfwSetKeyCallback(id->window, handleGlfwKeyEvent); glfwSetWindowUserPointer(id->window, ctx); glfwMakeContextCurrent(id->window); + if (!gladLoadGLES2Loader(reinterpret_cast(glfwGetProcAddress))) { + return OxError(2, "Could not init Glad"); + } if constexpr(config::ImGuiEnabled) { IMGUI_CHECKVERSION(); ImGui::CreateContext(); diff --git a/src/nostalgia/glutils/glutils.hpp b/src/nostalgia/glutils/glutils.hpp index 942ac514..c3ffaae1 100644 --- a/src/nostalgia/glutils/glutils.hpp +++ b/src/nostalgia/glutils/glutils.hpp @@ -6,15 +6,7 @@ #include -#define GL_GLEXT_PROTOTYPES 1 -#ifdef OX_OS_Darwin -#ifndef GL_SILENCE_DEPRECATION -#define GL_SILENCE_DEPRECATION -#endif -#include -#else #include -#endif #include #include