Created
December 17, 2017 12:50
-
-
Save chromedays/77410363bf71317e807595d1787e27ff to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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