[nostalgia] Setup Glad as GL loader
This commit is contained in:
@@ -2,9 +2,9 @@
|
||||
* Copyright 2016 - 2022 Gary Talent (gary@drinkingtea.net). All rights reserved.
|
||||
*/
|
||||
|
||||
#include <glad/glad.h>
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
#include <nostalgia/core/config.hpp>
|
||||
#include <nostalgia/core/gfx.hpp>
|
||||
#include <nostalgia/core/input.hpp>
|
||||
#include <nostalgia/core/userland/gfx.hpp>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* Copyright 2016 - 2022 Gary Talent (gary@drinkingtea.net). All rights reserved.
|
||||
*/
|
||||
|
||||
#include <glad/glad.h>
|
||||
#include <GLFW/glfw3.h>
|
||||
#include <imgui_impl_glfw.h>
|
||||
|
||||
@@ -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<GLADloadproc>(glfwGetProcAddress))) {
|
||||
return OxError(2, "Could not init Glad");
|
||||
}
|
||||
if constexpr(config::ImGuiEnabled) {
|
||||
IMGUI_CHECKVERSION();
|
||||
ImGui::CreateContext();
|
||||
|
||||
Reference in New Issue
Block a user