MCPcopy Create free account
hub / github.com/cginternals/glbinding / getProcAddress

Function getProcAddress

source/glbinding/source/getProcAddress.cpp:19–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17#ifdef SYSTEM_WINDOWS
18
19ProcAddress 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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected