MCPcopy Create free account
hub / github.com/NazaraEngine/NazaraEngine / LoadEntry

Function LoadEntry

src/Nazara/Renderer/OpenGL.cpp:29–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27 #endif
28
29 OpenGLFunc LoadEntry(const char* name, bool launchException = true)
30 {
31 #if defined(NAZARA_PLATFORM_WINDOWS)
32 OpenGLFunc entry = reinterpret_cast<OpenGLFunc>(wglGetProcAddress(name));
33 if (!entry) // wglGetProcAddress ne fonctionne pas sur les fonctions OpenGL <= 1.1
34 entry = reinterpret_cast<OpenGLFunc>(GetProcAddress(openGLlibrary, name));
35 #elif defined(NAZARA_PLATFORM_GLX)
36 OpenGLFunc entry = reinterpret_cast<OpenGLFunc>(GLX::glXGetProcAddress(reinterpret_cast<const unsigned char*>(name)));
37 #else
38 #error OS not handled
39 #endif
40
41 if (!entry && launchException)
42 {
43 std::ostringstream oss;
44 oss << "failed to load \"" << name << '"';
45
46 throw std::runtime_error(oss.str());
47 }
48
49 return entry;
50 }
51
52 bool LoadLibrary()
53 {

Callers 4

GetEntryMethod · 0.85
InitializeMethod · 0.85
GetEntryMethod · 0.85
InitializeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected