Subversion Repositories gelsvn

Rev

Rev 502 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 502 Rev 503
Line 10... Line 10...
10
  void print_glsl_program_log(GLuint program)
10
  void print_glsl_program_log(GLuint program)
11
  {
11
  {
12
    GLint infoLog_length = 0;
12
    GLint infoLog_length = 0;
13
    glGetProgramiv(program, GL_INFO_LOG_LENGTH, &infoLog_length);
13
    glGetProgramiv(program, GL_INFO_LOG_LENGTH, &infoLog_length);
14
 
14
 
15
    // Some drivers return 1 as infologLength when the infoLog is an empty string
15
    // Some drivers return 1 as infoLog_length when the infoLog is an empty string
16
    if(infoLog_length > 1) 
16
    if(infoLog_length > 1) 
17
    {
17
    {
18
      char* infoLog = new char[infoLog_length];
18
      char* infoLog = new char[infoLog_length];
19
      glGetProgramInfoLog(program, infoLog_length, 0, infoLog);
19
      glGetProgramInfoLog(program, infoLog_length, 0, infoLog);
20
      cerr << "InfoLog:" << endl << infoLog << endl << endl;
20
      cerr << "InfoLog:" << endl << infoLog << endl << endl;
Line 25... Line 25...
25
  void print_glsl_shader_log(GLuint shader)
25
  void print_glsl_shader_log(GLuint shader)
26
  {
26
  {
27
    GLint infoLog_length = 0;
27
    GLint infoLog_length = 0;
28
    glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &infoLog_length);
28
    glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &infoLog_length);
29
 
29
 
30
    // Some drivers return 1 as infologLength when the infoLog is an empty string
30
    // Some drivers return 1 as infoLog_length when the infoLog is an empty string
31
    if(infoLog_length > 1)
31
    if(infoLog_length > 1)
32
    {
32
    {
33
      char* infoLog = new char[infoLog_length];
33
      char* infoLog = new char[infoLog_length];
34
      glGetShaderInfoLog(shader, infoLog_length, 0, infoLog);
34
      glGetShaderInfoLog(shader, infoLog_length, 0, infoLog);
35
      cerr << "InfoLog:" << endl << infoLog << endl << endl;
35
      cerr << "InfoLog:" << endl << infoLog << endl << endl;