Skip to content

Instantly share code, notes, and snippets.

@nothings
Created July 31, 2014 15:19
Show Gist options
  • Save nothings/43f35d8b7010c7c024b7 to your computer and use it in GitHub Desktop.
Save nothings/43f35d8b7010c7c024b7 to your computer and use it in GitHub Desktop.
#define GDRAW_GL_EXTENSION_LIST \
/* identifier import procname */ \
/* GL_ARB_multitexture */ \
GLE(ActiveTexture, "ActiveTextureARB", ACTIVETEXTUREARB) \
/* GL_ARB_texture_compression */ \
GLE(CompressedTexImage2D, "CompressedTexImage2DARB", COMPRESSEDTEXIMAGE2DARB) \
/* GL_ARB_vertex_buffer_object */ \
GLE(GenBuffers, "GenBuffersARB", GENBUFFERSARB) \
GLE(DeleteBuffers, "DeleteBuffersARB", DELETEBUFFERSARB) \
GLE(BindBuffer, "BindBufferARB", BINDBUFFERARB) \
GLE(BufferData, "BufferDataARB", BUFFERDATAARB) \
/* ... */
#define GLE(id, import, procname) static PFNGL##procname##PROC gl##id;
GDRAW_GL_EXTENSION_LIST
#undef GLE
static void load_extensions(void)
{
#define GLE(id, import, procname) gl##id = (PFNGL##procname##PROC) wglGetProcAddress("gl" import);
GDRAW_GL_EXTENSION_LIST
#undef GLE
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment