From 00d97197db7874a67b3c92c5d3158f131b327c84 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 30 Nov 2018 17:16:21 +0100 Subject: [PATCH] - removed deprecated method to retrieve OpenGL extensions Since we force a core profile and this was explicitly disabled for core profiles, this code has no use anymore --- src/gl_load/gl_interface.cpp | 34 +++++----------------------------- 1 file changed, 5 insertions(+), 29 deletions(-) diff --git a/src/gl_load/gl_interface.cpp b/src/gl_load/gl_interface.cpp index d690a1a15..d2dc502db 100644 --- a/src/gl_load/gl_interface.cpp +++ b/src/gl_load/gl_interface.cpp @@ -52,35 +52,11 @@ static void CollectExtensions() int max = 0; glGetIntegerv(GL_NUM_EXTENSIONS, &max); - if (max == 0) + // Use modern method to collect extensions + for (int i = 0; i < max; i++) { - // Try old method to collect extensions - const char *supported = (char *)glGetString(GL_EXTENSIONS); - - if (nullptr != supported) - { - char *extensions = new char[strlen(supported) + 1]; - strcpy(extensions, supported); - - char *extension = strtok(extensions, " "); - - while (extension) - { - m_Extensions.Push(FString(extension)); - extension = strtok(nullptr, " "); - } - - delete [] extensions; - } - } - else - { - // Use modern method to collect extensions - for (int i = 0; i < max; i++) - { - extension = (const char*)glGetStringi(GL_EXTENSIONS, i); - m_Extensions.Push(FString(extension)); - } + extension = (const char*)glGetStringi(GL_EXTENSIONS, i); + m_Extensions.Push(FString(extension)); } } @@ -269,4 +245,4 @@ std::pair gl_getInfo() // gl_ARB_bindless_texture is the closest we can get to determine Vulkan support from OpenGL. // This isn't foolproof because Intel doesn't support it but for NVidia and AMD support of this extension means Vulkan support. return std::make_pair(realglversion, CheckExtension("GL_ARB_bindless_texture")); -} \ No newline at end of file +}