mirror of
https://github.com/grumpycoders/pcsx-redux.git
synced 2025-04-02 10:41:54 -04:00
41 lines
576 B
C++
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;
|
|
}
|