Skip to content

Instantly share code, notes, and snippets.

@chromedays
Created December 17, 2017 12:50
Show Gist options
  • Save chromedays/77410363bf71317e807595d1787e27ff to your computer and use it in GitHub Desktop.
Save chromedays/77410363bf71317e807595d1787e27ff to your computer and use it in GitHub Desktop.
#define GLE(ret, name, ...) name##Func* gl##name;
GL_LIST
#undef GLE
b32 gl_load_extensions()
{
b32 result = false;
if (SDL_GL_LoadLibrary(nullptr) != 0)
{
LOG("%s", SDL_GetError());
return result;
}
result = true;
#define GLE(ret, name, ...) \
gl##name = (name##Func*)SDL_GL_GetProcAddress("gl" #name); \
if (!gl##name) \
{ \
LOG("%s is not loaded!", "gl" #name); \
result = false; \
}
GL_LIST
#undef GLE
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment