diff options
author | Trond Kjernåsen <trond@trolltech.com> | 2009-06-09 08:45:19 (GMT) |
---|---|---|
committer | Trond Kjernåsen <trond@trolltech.com> | 2009-06-09 08:46:43 (GMT) |
commit | 6b628fb9754629cc8cdd5718edec296b02ab3b0e (patch) | |
tree | 8b4d69d6b9f30b2a264e2837f16f71c9c69f3894 /demos | |
parent | 96d6eb1da01287bd9dcd658cbd355f00d34ef4b3 (diff) | |
download | Qt-6b628fb9754629cc8cdd5718edec296b02ab3b0e.zip Qt-6b628fb9754629cc8cdd5718edec296b02ab3b0e.tar.gz Qt-6b628fb9754629cc8cdd5718edec296b02ab3b0e.tar.bz2 |
Fixed a compile issue on Solaris.
GLchar is defined to be unsigned on Solaris for some reason.
Reviewed-by: Tom
Diffstat (limited to 'demos')
-rw-r--r-- | demos/boxes/glshaders.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/demos/boxes/glshaders.cpp b/demos/boxes/glshaders.cpp index b6999a8..05bbf71 100644 --- a/demos/boxes/glshaders.cpp +++ b/demos/boxes/glshaders.cpp @@ -58,7 +58,7 @@ GLShader::GLShader(const char *data, int size, GLenum shaderType) m_shader = glCreateShaderObjectARB(shaderType); GLint glSize = size; - glShaderSourceARB(m_shader, 1, &data, &glSize); + glShaderSourceARB(m_shader, 1, static_cast<const GLcharARB**>(&data), &glSize); glCompileShaderARB(m_shader); int status; glGetObjectParameterivARB(m_shader, GL_OBJECT_COMPILE_STATUS_ARB, &status); @@ -79,7 +79,7 @@ GLShader::GLShader(const QString& fileName, GLenum shaderType) GLint size = file.size(); const char *p = bytes.data(); file.close(); - glShaderSourceARB(m_shader, 1, &p, &size); + glShaderSourceARB(m_shader, 1, static_cast<const GLcharARB**>(&p), &size); glCompileShaderARB(m_shader); int status; glGetObjectParameterivARB(m_shader, GL_OBJECT_COMPILE_STATUS_ARB, &status); @@ -105,7 +105,7 @@ QString GLShader::log() glGetObjectParameterivARB(m_shader, GL_OBJECT_INFO_LOG_LENGTH_ARB, &length); char *log = new char[length + 1]; GLsizei glLength = length; - glGetInfoLogARB(m_shader, glLength, &glLength, log); + glGetInfoLogARB(m_shader, glLength, &glLength, static_cast<GLcharARB*>(log)); log[glLength] = '\0'; QString result(log); delete log; @@ -184,7 +184,7 @@ QString GLProgram::log() glGetObjectParameterivARB(m_program, GL_OBJECT_INFO_LOG_LENGTH_ARB, &length); char *log = new char[length + 1]; GLsizei glLength = length; - glGetInfoLogARB(m_program, glLength, &glLength, log); + glGetInfoLogARB(m_program, glLength, &glLength, static_cast<GLcharARB*>(log)); log[glLength] = '\0'; QString result(log); delete log; @@ -212,7 +212,7 @@ bool GLProgram::hasParameter(const QString& name) if (!failed()) { QByteArray asciiName = name.toAscii(); - return -1 != glGetUniformLocationARB(m_program, asciiName.data()); + return -1 != glGetUniformLocationARB(m_program, static_cast<const GLcharARB*>(asciiName.data())); } return false; } @@ -223,7 +223,7 @@ void GLProgram::setInt(const QString& name, int value) if (!failed()) { QByteArray asciiName = name.toAscii(); - int loc = glGetUniformLocationARB(m_program, asciiName.data()); + int loc = glGetUniformLocationARB(m_program, static_cast<const GLcharARB*>(asciiName.data())); glUniform1iARB(loc, value); } } @@ -234,7 +234,7 @@ void GLProgram::setFloat(const QString& name, float value) if (!failed()) { QByteArray asciiName = name.toAscii(); - int loc = glGetUniformLocationARB(m_program, asciiName.data()); + int loc = glGetUniformLocationARB(m_program, static_cast<const GLcharARB*>(asciiName.data())); glUniform1fARB(loc, value); } } @@ -246,7 +246,7 @@ void GLProgram::setColor(const QString& name, QRgb value) //qDebug() << "Setting color" << name; if (!failed()) { QByteArray asciiName = name.toAscii(); - int loc = glGetUniformLocationARB(m_program, asciiName.data()); + int loc = glGetUniformLocationARB(m_program, static_cast<const GLcharARB*>(asciiName.data())); //qDebug() << "Location of" << name << "is" << loc; QColor color(value); glUniform4fARB(loc, color.redF(), color.greenF(), color.blueF(), color.alphaF()); @@ -259,8 +259,8 @@ void GLProgram::setMatrix(const QString& name, const gfx::Matrix4x4f &mat) if (!failed()) { QByteArray asciiName = name.toAscii(); - int loc = glGetUniformLocationARB(m_program, asciiName.data()); + int loc = glGetUniformLocationARB(m_program, static_cast<const GLcharARB*>(asciiName.data())); //qDebug() << "Location of" << name << "is" << loc; glUniformMatrix4fvARB(loc, 1, GL_FALSE, mat.bits()); } -}
\ No newline at end of file +} |