From b12c15ab5d16043ba713a31799a1ad1eff701638 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Sat, 29 Mar 2014 19:19:31 +0100 Subject: [PATCH] Follow existing code style --HG-- branch : opengl3 --- .../src/3d/driver/opengl3/driver_opengl.cpp | 11 ++++++++++ .../opengl3/driver_opengl_extension.cpp | 22 +++++++------------ .../driver/opengl3/driver_opengl_extension.h | 2 ++ 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/code/nel/src/3d/driver/opengl3/driver_opengl.cpp b/code/nel/src/3d/driver/opengl3/driver_opengl.cpp index f1b6cca41..9021de194 100644 --- a/code/nel/src/3d/driver/opengl3/driver_opengl.cpp +++ b/code/nel/src/3d/driver/opengl3/driver_opengl.cpp @@ -373,6 +373,17 @@ bool CDriverGL3::setupDisplay() #endif // NL_OS_WINDOWS // Check required extensions!! + if (!_Extensions.ARBShaderObjects) + { + nlwarning("Missing Required GL extension: GL_ARB_shader_objects. Update your driver"); + throw EBadDisplay("Missing Required GL extension: GL_ARB_shader_objects. Update your driver"); + } + if (!_Extensions.ARBSeparateShaderObjects) + { + nlwarning("Missing Required GL extension: GL_ARB_separate_shader_objects. Update your driver"); + throw EBadDisplay("Missing Required GL extension: GL_ARB_separate_shader_objects. Update your driver"); + } + // ARBMultiTexture is a OpenGL 1.2 required extension. if (!_Extensions.ARBMultiTexture) { diff --git a/code/nel/src/3d/driver/opengl3/driver_opengl_extension.cpp b/code/nel/src/3d/driver/opengl3/driver_opengl_extension.cpp index 745ceeeb6..75b0b3d17 100644 --- a/code/nel/src/3d/driver/opengl3/driver_opengl_extension.cpp +++ b/code/nel/src/3d/driver/opengl3/driver_opengl_extension.cpp @@ -833,7 +833,7 @@ static bool setupPackedDepthStencil(const char *glext) return true; } -static bool setupGLSL(const char *glext) +static bool setupARBShaderObjects(const char *glext) { CHECK_EXT("GL_ARB_shader_objects"); @@ -890,7 +890,7 @@ static bool setupGLSL(const char *glext) return true; } -static bool setupSeparateShaderObjects(const char *glext) +static bool setupARBSeparateShaderObjects(const char *glext) { CHECK_EXT("GL_ARB_separate_shader_objects"); @@ -994,6 +994,12 @@ void registerGlExtensions(CGlExtensions &ext) DebugLog->displayRaw("\n"); } + // Check GL_ARB_shader_objects + ext.ARBShaderObjects = setupARBShaderObjects(glext); + + // Check GL_ARB_separate_shader_objects + ext.ARBSeparateShaderObjects = setupARBSeparateShaderObjects(glext); + // Check ARBMultiTexture ext.ARBMultiTexture= setupARBMultiTexture(glext); if (ext.ARBMultiTexture) @@ -1076,18 +1082,6 @@ void registerGlExtensions(CGlExtensions &ext) ext.ATIXTextureEnvRoute= setupATIXTextureEnvRoute(glext); setupARBVertexBufferObject(glext); - - if (!setupGLSL(glext)) - { - nlinfo("Failed to set up GLSL related calls!"); - nlassert(false); - } - - if (!setupSeparateShaderObjects(glext)) - { - nlinfo("Failed to set up separate shader object calls!"); - nlassert(false); - } } diff --git a/code/nel/src/3d/driver/opengl3/driver_opengl_extension.h b/code/nel/src/3d/driver/opengl3/driver_opengl_extension.h index 28d801b7e..cf4adcc6f 100644 --- a/code/nel/src/3d/driver/opengl3/driver_opengl_extension.h +++ b/code/nel/src/3d/driver/opengl3/driver_opengl_extension.h @@ -36,6 +36,8 @@ struct CGlExtensions std::string GLVersion; // Required Extensions. + bool ARBShaderObjects; + bool ARBSeparateShaderObjects; bool ARBMultiTexture; uint NbTextureStages; bool EXTTextureEnvCombine;