From 694da2ee4f6bf7dd8e5f592f9d9ecf0c5a7ceb24 Mon Sep 17 00:00:00 2001 From: Takamichi Horikawa Date: Fri, 8 Sep 2017 23:26:30 +0900 Subject: sdl: for testing pacc --- sdl/pacc-gl-inc.h | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 sdl/pacc-gl-inc.h (limited to 'sdl/pacc-gl-inc.h') diff --git a/sdl/pacc-gl-inc.h b/sdl/pacc-gl-inc.h new file mode 100644 index 0000000..88e4aec --- /dev/null +++ b/sdl/pacc-gl-inc.h @@ -0,0 +1,51 @@ + +#ifdef PACC_GL_ES +#ifdef PACC_GL_3 +#include +#else +#include +#endif +#else // PACC_GL_ES +#ifdef PACC_GL_3 +#include +#else +#ifdef _WIN32 +#define PROC_NO_GL_1_1 +#include +#include +#else +#define PROC_NO_GL_1_3 +#include +#endif +#endif // PACC_GL_3 +#endif // PACC_GL_ES + +#ifdef PACC_GL_ES +bool loadgl(void) { + return true; +} +#else // PACC_GL_ES +#include +#define PROC(N, n) static PFNGL##N##PROC gl##n; +#include "pacc/pacc-gl-procs.inc" +#undef PROC +#define PROC(N, n) \ + gl##n = SDL_GL_GetProcAddress("gl" #n);\ + if (!gl##n) {\ + SDL_Log("Cannot load GL function \"gl" #n "\"\n");\ + return false;\ + } + +bool loadgl(void) { +#include "pacc/pacc-gl-procs.inc" + return true; +} +#undef PROC +#endif // PACC_GL_ES + +#ifdef PROC_NO_GL_1_1 +#undef PROC_NO_GL_1_1 +#endif +#ifdef PROC_NO_GL_1_3 +#undef PROC_NO_GL_1_3 +#endif -- cgit v1.2.3