12#define GLFW_INCLUDE_NONE
13#include "GLFW/glfw3.h"
18 inline void glfwErrorCallback(
int iErrorCode,
const char* pDescription) {
19 const auto sMessage =
"GLFW error (" + std::to_string(iErrorCode) +
"): " + std::string(pDescription);
21 if (iErrorCode == GLFW_FEATURE_UNAVAILABLE) {
27 const Error error(sMessage);
29 throw std::runtime_error(error.getFullErrorMessage());
36 GLFW& operator=(
const GLFW&) =
delete;
54 glfwSetErrorCallback(ne::glfwErrorCallback);
56 if (glfwInit() != GLFW_TRUE) {
57 const Error error(
"failed to initialize GLFW");
std::string getFullErrorMessage() const
Definition: Error.cpp:84
void showError() const
Definition: Error.cpp:102
~GLFW()
Definition: GLFW.hpp:39
GLFW()
Definition: GLFW.hpp:53
static GLFW & get()
Definition: GLFW.hpp:46
void error(std::string_view sText, const std::source_location location=std::source_location::current()) const
Definition: Logger.cpp:75
static Logger & get()
Definition: Logger.cpp:41