Follow existing code style

--HG--
branch : opengl3
hg/feature/opengl3
kaetemi 11 years ago
parent 99f37eb90c
commit b12c15ab5d

@ -373,6 +373,17 @@ bool CDriverGL3::setupDisplay()
#endif // NL_OS_WINDOWS #endif // NL_OS_WINDOWS
// Check required extensions!! // 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. // ARBMultiTexture is a OpenGL 1.2 required extension.
if (!_Extensions.ARBMultiTexture) if (!_Extensions.ARBMultiTexture)
{ {

@ -833,7 +833,7 @@ static bool setupPackedDepthStencil(const char *glext)
return true; return true;
} }
static bool setupGLSL(const char *glext) static bool setupARBShaderObjects(const char *glext)
{ {
CHECK_EXT("GL_ARB_shader_objects"); CHECK_EXT("GL_ARB_shader_objects");
@ -890,7 +890,7 @@ static bool setupGLSL(const char *glext)
return true; return true;
} }
static bool setupSeparateShaderObjects(const char *glext) static bool setupARBSeparateShaderObjects(const char *glext)
{ {
CHECK_EXT("GL_ARB_separate_shader_objects"); CHECK_EXT("GL_ARB_separate_shader_objects");
@ -994,6 +994,12 @@ void registerGlExtensions(CGlExtensions &ext)
DebugLog->displayRaw("\n"); DebugLog->displayRaw("\n");
} }
// Check GL_ARB_shader_objects
ext.ARBShaderObjects = setupARBShaderObjects(glext);
// Check GL_ARB_separate_shader_objects
ext.ARBSeparateShaderObjects = setupARBSeparateShaderObjects(glext);
// Check ARBMultiTexture // Check ARBMultiTexture
ext.ARBMultiTexture= setupARBMultiTexture(glext); ext.ARBMultiTexture= setupARBMultiTexture(glext);
if (ext.ARBMultiTexture) if (ext.ARBMultiTexture)
@ -1076,18 +1082,6 @@ void registerGlExtensions(CGlExtensions &ext)
ext.ATIXTextureEnvRoute= setupATIXTextureEnvRoute(glext); ext.ATIXTextureEnvRoute= setupATIXTextureEnvRoute(glext);
setupARBVertexBufferObject(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);
}
} }

@ -36,6 +36,8 @@ struct CGlExtensions
std::string GLVersion; std::string GLVersion;
// Required Extensions. // Required Extensions.
bool ARBShaderObjects;
bool ARBSeparateShaderObjects;
bool ARBMultiTexture; bool ARBMultiTexture;
uint NbTextureStages; uint NbTextureStages;
bool EXTTextureEnvCombine; bool EXTTextureEnvCombine;

Loading…
Cancel
Save