tags:

views:

104

answers:

1

hello, i am using this code to check if my glsl shader compiled fine.

    glGetObjectParameterivARB(obj, GL_OBJECT_INFO_LOG_LENGTH_ARB, &infologLength);

    if (infologLength > 1)
    {
        int charsWritten  = 0;
        char * const infoLog = new char[infologLength];
        glGetInfoLogARB(obj, infologLength, &charsWritten, infoLog);
        tError(infoLog, false);
        delete infoLog;
    }
}

the length of the returned string is empty on nvidia and ATI cards, but on intel cards this one returns the string "no errors."

now what is the best way to find out, if there are really no errors? should i just check for this string? or is there a convention what this function glGetInfoLogARB should return?

+3  A: 

Try

bool CompileSuccessful(int obj) {
  int status;
  glGetShaderiv(obj, GL_COMPILE_STATUS, &status);
  return status == GL_TRUE;
}

to check if a shader was compiled successfully and

bool LinkSuccessful(int obj) {
  int status;
  glGetProgramiv(obj, GL_LINK_STATUS, &status);
  return status == GL_TRUE;
}

to check if the whole program was linked successfully.

Danvil
thanks but it seems it doesnt work on my intel card. the value of status isnt changed at all.
clamp
Does your intel card support the necessary extensions to use shaders?
Danvil
yes they do. it is supposed to support openGL 2.0
clamp