Advertisement
dejv25

any OpenGL function address

Jun 29th, 2015
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.32 KB | None | 0 0
  1. void *GetAnyGLFuncAddress(const char *name)
  2. {
  3.   void *p = (void *)wglGetProcAddress(name);
  4.   if(p == 0 ||
  5.     (p == (void*)0x1) || (p == (void*)0x2) || (p == (void*)0x3) ||
  6.     (p == (void*)-1) )
  7.   {
  8.     HMODULE module = LoadLibraryA("opengl32.dll");
  9.     p = (void *)GetProcAddress(module, name);
  10.   }
  11.  
  12.   return p;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement