| 17 | #ifdef SYSTEM_WINDOWS |
| 18 | |
| 19 | ProcAddress getProcAddress(const char * name) |
| 20 | { |
| 21 | static auto module = LoadLibrary(_T("OPENGL32.DLL")); |
| 22 | |
| 23 | // Prevent static linking of opengl32 |
| 24 | static auto wglGetProcAddress_ = reinterpret_cast<void * (__stdcall *)(const char *)>((uintptr_t) ::GetProcAddress(module, "wglGetProcAddress")); |
| 25 | assert(wglGetProcAddress_ != nullptr); |
| 26 | |
| 27 | auto procAddress = wglGetProcAddress_(name); |
| 28 | if (procAddress != nullptr) |
| 29 | { |
| 30 | return reinterpret_cast<ProcAddress>(procAddress); |
| 31 | } |
| 32 | |
| 33 | procAddress = (void *) ::GetProcAddress(module, name); |
| 34 | return reinterpret_cast<ProcAddress>(procAddress); |
| 35 | } |
| 36 | |
| 37 | #else |
| 38 |
nothing calls this directly
no outgoing calls
no test coverage detected