mojoshader_opengl.c
branchtrunk
changeset 363 bea8bf9e5536
parent 362 1aa8a74bb5a5
child 388 5930c6cd840e
equal deleted inserted replaced
362:1aa8a74bb5a5 363:bea8bf9e5536
   300     return retval;
   300     return retval;
   301 } // loadsym
   301 } // loadsym
   302 
   302 
   303 static void lookup_entry_points(void *(*lookup)(const char *fnname))
   303 static void lookup_entry_points(void *(*lookup)(const char *fnname))
   304 {
   304 {
   305     #define DO_LOOKUP(ext, typ, fn) ctx->fn = (typ) loadsym(lookup, #fn, &ctx->have_##ext)
   305     #define DO_LOOKUP(ext, typ, fn) { \
       
   306         int exist = ctx->have_##ext; \
       
   307         ctx->fn = (typ) loadsym(lookup, #fn, &exist); \
       
   308         ctx->have_##ext = exist; \
       
   309     }
       
   310 
   306     DO_LOOKUP(base_opengl, PFNGLGETSTRINGPROC, glGetString);
   311     DO_LOOKUP(base_opengl, PFNGLGETSTRINGPROC, glGetString);
   307     DO_LOOKUP(base_opengl, PFNGLGETERRORPROC, glGetError);
   312     DO_LOOKUP(base_opengl, PFNGLGETERRORPROC, glGetError);
   308     DO_LOOKUP(base_opengl, PFNGLGETINTEGERVPROC, glGetIntegerv);
   313     DO_LOOKUP(base_opengl, PFNGLGETINTEGERVPROC, glGetIntegerv);
   309     DO_LOOKUP(base_opengl, PFNGLENABLEPROC, glEnable);
   314     DO_LOOKUP(base_opengl, PFNGLENABLEPROC, glEnable);
   310     DO_LOOKUP(base_opengl, PFNGLDISABLEPROC, glDisable);
   315     DO_LOOKUP(base_opengl, PFNGLDISABLEPROC, glDisable);