[nostalgia] Setup Glad as GL loader
This commit is contained in:
parent
e7ecb65f7a
commit
c80a8838a4
@ -2,9 +2,9 @@
|
|||||||
* Copyright 2016 - 2022 Gary Talent (gary@drinkingtea.net). All rights reserved.
|
* Copyright 2016 - 2022 Gary Talent (gary@drinkingtea.net). All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <glad/glad.h>
|
||||||
#include <GLFW/glfw3.h>
|
#include <GLFW/glfw3.h>
|
||||||
|
|
||||||
#include <nostalgia/core/config.hpp>
|
|
||||||
#include <nostalgia/core/gfx.hpp>
|
#include <nostalgia/core/gfx.hpp>
|
||||||
#include <nostalgia/core/input.hpp>
|
#include <nostalgia/core/input.hpp>
|
||||||
#include <nostalgia/core/userland/gfx.hpp>
|
#include <nostalgia/core/userland/gfx.hpp>
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
* Copyright 2016 - 2022 Gary Talent (gary@drinkingtea.net). All rights reserved.
|
* Copyright 2016 - 2022 Gary Talent (gary@drinkingtea.net). All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <glad/glad.h>
|
||||||
#include <GLFW/glfw3.h>
|
#include <GLFW/glfw3.h>
|
||||||
#include <imgui_impl_glfw.h>
|
#include <imgui_impl_glfw.h>
|
||||||
|
|
||||||
@ -109,6 +110,9 @@ ox::Error initGfx(Context *ctx) noexcept {
|
|||||||
glfwSetKeyCallback(id->window, handleGlfwKeyEvent);
|
glfwSetKeyCallback(id->window, handleGlfwKeyEvent);
|
||||||
glfwSetWindowUserPointer(id->window, ctx);
|
glfwSetWindowUserPointer(id->window, ctx);
|
||||||
glfwMakeContextCurrent(id->window);
|
glfwMakeContextCurrent(id->window);
|
||||||
|
if (!gladLoadGLES2Loader(reinterpret_cast<GLADloadproc>(glfwGetProcAddress))) {
|
||||||
|
return OxError(2, "Could not init Glad");
|
||||||
|
}
|
||||||
if constexpr(config::ImGuiEnabled) {
|
if constexpr(config::ImGuiEnabled) {
|
||||||
IMGUI_CHECKVERSION();
|
IMGUI_CHECKVERSION();
|
||||||
ImGui::CreateContext();
|
ImGui::CreateContext();
|
||||||
|
@ -6,15 +6,7 @@
|
|||||||
|
|
||||||
#include <ox/std/defines.hpp>
|
#include <ox/std/defines.hpp>
|
||||||
|
|
||||||
#define GL_GLEXT_PROTOTYPES 1
|
|
||||||
#ifdef OX_OS_Darwin
|
|
||||||
#ifndef GL_SILENCE_DEPRECATION
|
|
||||||
#define GL_SILENCE_DEPRECATION
|
|
||||||
#endif
|
|
||||||
#include <OpenGL/gl3.h>
|
|
||||||
#else
|
|
||||||
#include <glad/glad.h>
|
#include <glad/glad.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <ox/std/error.hpp>
|
#include <ox/std/error.hpp>
|
||||||
#include <ox/std/string.hpp>
|
#include <ox/std/string.hpp>
|
||||||
|
Loading…
Reference in New Issue
Block a user