pcsx-redux/third_party/gl3w/GL/gl3w-throwers.cc
2023-04-05 22:34:38 -07:00

41 lines
576 B
C++

#include <stdexcept>
#include "gl3w.h"
namespace {
#define GL3W_SYMBOL(x) \
void no##x() { \
throw std::runtime_error("gl" #x " not loaded"); \
}
#include "gl3w-list.h"
#undef GL3W_SYMBOL
}
extern "C" GL3W_API void gl3wFillCppThrowers() {
unsigned i = 0;
#define GL3W_SYMBOL(x) \
if (!gl3wProcs.ptr[i]) gl3wProcs.ptr[i] = no##x; \
i++;
#include "gl3w-list.h"
#undef GL3W_SYMBOL
}
extern "C" GL3W_API int gl3wIsCppThrower(GL3WglProc proc) {
#define GL3W_SYMBOL(x) \
if (proc == no##x) \
return 1;
#include "gl3w-list.h"
#undef GL3W_SYMBOL
return 0;
}