| 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 | { |
no outgoing calls
no test coverage detected