Fix some more typos in gl extension usage and new GLSL interface
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@3226 dfc29bdd-3216-0410-991c-e03cc46cb475master
parent
aee05c3199
commit
9c4bb40b6c
|
@ -170,8 +170,8 @@ void COpenGLExtensionHandler::initExtensions(bool stencilBuffer)
|
||||||
pGlGetShaderInfoLog = (PFNGLGETSHADERINFOLOGPROC) wglGetProcAddress("glGetShaderInfoLog");
|
pGlGetShaderInfoLog = (PFNGLGETSHADERINFOLOGPROC) wglGetProcAddress("glGetShaderInfoLog");
|
||||||
pGlGetProgramInfoLog = (PFNGLGETPROGRAMINFOLOGPROC) wglGetProcAddress("glGetProgramInfoLog");
|
pGlGetProgramInfoLog = (PFNGLGETPROGRAMINFOLOGPROC) wglGetProcAddress("glGetProgramInfoLog");
|
||||||
pGlGetObjectParameterivARB = (PFNGLGETOBJECTPARAMETERIVARBPROC) wglGetProcAddress("glGetObjectParameterivARB");
|
pGlGetObjectParameterivARB = (PFNGLGETOBJECTPARAMETERIVARBPROC) wglGetProcAddress("glGetObjectParameterivARB");
|
||||||
pGlGetShaderiv = (PFNGLGETSHADERIVPROC) wglGetProcAddress("glGetShader");
|
pGlGetShaderiv = (PFNGLGETSHADERIVPROC) wglGetProcAddress("glGetShaderiv");
|
||||||
pGlGetProgramiv = (PFNGLGETPROGRAMIVPROC) wglGetProcAddress("glGetProgram");
|
pGlGetProgramiv = (PFNGLGETPROGRAMIVPROC) wglGetProcAddress("glGetProgramiv");
|
||||||
pGlGetUniformLocationARB = (PFNGLGETUNIFORMLOCATIONARBPROC) wglGetProcAddress("glGetUniformLocationARB");
|
pGlGetUniformLocationARB = (PFNGLGETUNIFORMLOCATIONARBPROC) wglGetProcAddress("glGetUniformLocationARB");
|
||||||
pGlGetUniformLocation = (PFNGLGETUNIFORMLOCATIONPROC) wglGetProcAddress("glGetUniformLocation");
|
pGlGetUniformLocation = (PFNGLGETUNIFORMLOCATIONPROC) wglGetProcAddress("glGetUniformLocation");
|
||||||
pGlUniform4fvARB = (PFNGLUNIFORM4FVARBPROC) wglGetProcAddress("glUniform4fvARB");
|
pGlUniform4fvARB = (PFNGLUNIFORM4FVARBPROC) wglGetProcAddress("glUniform4fvARB");
|
||||||
|
@ -370,10 +370,10 @@ void COpenGLExtensionHandler::initExtensions(bool stencilBuffer)
|
||||||
IRR_OGL_LOAD_EXTENSION(reinterpret_cast<const GLubyte*>("glGetObjectParameterivARB"));
|
IRR_OGL_LOAD_EXTENSION(reinterpret_cast<const GLubyte*>("glGetObjectParameterivARB"));
|
||||||
|
|
||||||
pGlGetShaderiv = (PFNGLGETSHADERIVPROC)
|
pGlGetShaderiv = (PFNGLGETSHADERIVPROC)
|
||||||
IRR_OGL_LOAD_EXTENSION(reinterpret_cast<const GLubyte*>("glGetShader"));
|
IRR_OGL_LOAD_EXTENSION(reinterpret_cast<const GLubyte*>("glGetShaderiv"));
|
||||||
|
|
||||||
pGlGetProgramiv = (PFNGLGETPROGRAMIVPROC)
|
pGlGetProgramiv = (PFNGLGETPROGRAMIVPROC)
|
||||||
IRR_OGL_LOAD_EXTENSION(reinterpret_cast<const GLubyte*>("glGetProgram"));
|
IRR_OGL_LOAD_EXTENSION(reinterpret_cast<const GLubyte*>("glGetProgramiv"));
|
||||||
|
|
||||||
pGlGetUniformLocationARB = (PFNGLGETUNIFORMLOCATIONARBPROC)
|
pGlGetUniformLocationARB = (PFNGLGETUNIFORMLOCATIONARBPROC)
|
||||||
IRR_OGL_LOAD_EXTENSION(reinterpret_cast<const GLubyte*>("glGetUniformLocationARB"));
|
IRR_OGL_LOAD_EXTENSION(reinterpret_cast<const GLubyte*>("glGetUniformLocationARB"));
|
||||||
|
|
|
@ -252,7 +252,7 @@ bool COpenGLSLMaterialRenderer::createShader(GLenum shaderType, const char* shad
|
||||||
if (Program2)
|
if (Program2)
|
||||||
{
|
{
|
||||||
GLuint shaderHandle = Driver->extGlCreateShader(shaderType);
|
GLuint shaderHandle = Driver->extGlCreateShader(shaderType);
|
||||||
Driver->extGlShaderSource(Program2, 1, &shader, NULL);
|
Driver->extGlShaderSource(shaderHandle, 1, &shader, NULL);
|
||||||
Driver->extGlCompileShader(shaderHandle);
|
Driver->extGlCompileShader(shaderHandle);
|
||||||
|
|
||||||
GLint status = 0;
|
GLint status = 0;
|
||||||
|
@ -261,7 +261,7 @@ bool COpenGLSLMaterialRenderer::createShader(GLenum shaderType, const char* shad
|
||||||
Driver->extGlGetShaderiv(shaderHandle, GL_COMPILE_STATUS, &status);
|
Driver->extGlGetShaderiv(shaderHandle, GL_COMPILE_STATUS, &status);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!status)
|
if (status != GL_TRUE)
|
||||||
{
|
{
|
||||||
os::Printer::log("GLSL shader failed to compile", ELL_ERROR);
|
os::Printer::log("GLSL shader failed to compile", ELL_ERROR);
|
||||||
// check error message and log it
|
// check error message and log it
|
||||||
|
@ -271,10 +271,13 @@ bool COpenGLSLMaterialRenderer::createShader(GLenum shaderType, const char* shad
|
||||||
Driver->extGlGetShaderiv(shaderHandle, GL_INFO_LOG_LENGTH,
|
Driver->extGlGetShaderiv(shaderHandle, GL_INFO_LOG_LENGTH,
|
||||||
&maxLength);
|
&maxLength);
|
||||||
#endif
|
#endif
|
||||||
GLchar *infoLog = new GLchar[maxLength];
|
if (maxLength)
|
||||||
Driver->extGlGetShaderInfoLog(shaderHandle, maxLength, &length, infoLog);
|
{
|
||||||
os::Printer::log(reinterpret_cast<const c8*>(infoLog), ELL_ERROR);
|
GLchar *infoLog = new GLchar[maxLength];
|
||||||
delete [] infoLog;
|
Driver->extGlGetShaderInfoLog(shaderHandle, maxLength, &length, infoLog);
|
||||||
|
os::Printer::log(reinterpret_cast<const c8*>(infoLog), ELL_ERROR);
|
||||||
|
delete [] infoLog;
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -304,10 +307,13 @@ bool COpenGLSLMaterialRenderer::createShader(GLenum shaderType, const char* shad
|
||||||
Driver->extGlGetObjectParameteriv(shaderHandle,
|
Driver->extGlGetObjectParameteriv(shaderHandle,
|
||||||
GL_OBJECT_INFO_LOG_LENGTH_ARB, &maxLength);
|
GL_OBJECT_INFO_LOG_LENGTH_ARB, &maxLength);
|
||||||
#endif
|
#endif
|
||||||
GLcharARB *infoLog = new GLcharARB[maxLength];
|
if (maxLength)
|
||||||
Driver->extGlGetInfoLog(shaderHandle, maxLength, &length, infoLog);
|
{
|
||||||
os::Printer::log(reinterpret_cast<const c8*>(infoLog), ELL_ERROR);
|
GLcharARB *infoLog = new GLcharARB[maxLength];
|
||||||
delete [] infoLog;
|
Driver->extGlGetInfoLog(shaderHandle, maxLength, &length, infoLog);
|
||||||
|
os::Printer::log(reinterpret_cast<const c8*>(infoLog), ELL_ERROR);
|
||||||
|
delete [] infoLog;
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -339,10 +345,13 @@ bool COpenGLSLMaterialRenderer::linkProgram()
|
||||||
#ifdef GL_VERSION_2_0
|
#ifdef GL_VERSION_2_0
|
||||||
Driver->extGlGetProgramiv(Program2, GL_INFO_LOG_LENGTH, &maxLength);
|
Driver->extGlGetProgramiv(Program2, GL_INFO_LOG_LENGTH, &maxLength);
|
||||||
#endif
|
#endif
|
||||||
GLchar *infoLog = new GLchar[maxLength];
|
if (maxLength)
|
||||||
Driver->extGlGetProgramInfoLog(Program2, maxLength, &length, infoLog);
|
{
|
||||||
os::Printer::log(reinterpret_cast<const c8*>(infoLog), ELL_ERROR);
|
GLchar *infoLog = new GLchar[maxLength];
|
||||||
delete [] infoLog;
|
Driver->extGlGetProgramInfoLog(Program2, maxLength, &length, infoLog);
|
||||||
|
os::Printer::log(reinterpret_cast<const c8*>(infoLog), ELL_ERROR);
|
||||||
|
delete [] infoLog;
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -412,10 +421,13 @@ bool COpenGLSLMaterialRenderer::linkProgram()
|
||||||
Driver->extGlGetObjectParameteriv(Program,
|
Driver->extGlGetObjectParameteriv(Program,
|
||||||
GL_OBJECT_INFO_LOG_LENGTH_ARB, &maxLength);
|
GL_OBJECT_INFO_LOG_LENGTH_ARB, &maxLength);
|
||||||
#endif
|
#endif
|
||||||
GLcharARB *infoLog = new GLcharARB[maxLength];
|
if (maxLength)
|
||||||
Driver->extGlGetInfoLog(Program, maxLength, &length, infoLog);
|
{
|
||||||
os::Printer::log(reinterpret_cast<const c8*>(infoLog), ELL_ERROR);
|
GLcharARB *infoLog = new GLcharARB[maxLength];
|
||||||
delete [] infoLog;
|
Driver->extGlGetInfoLog(Program, maxLength, &length, infoLog);
|
||||||
|
os::Printer::log(reinterpret_cast<const c8*>(infoLog), ELL_ERROR);
|
||||||
|
delete [] infoLog;
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue